How do I use ng.material.MdDialog in ES5?
We need to use the ES5 flavor of Angular 2 and material 2.
We are stuck using the materials dialog. What we have done so far:
var parentComponent = ng.core.Component({
templateUrl: '/parentComponent.html'
selector: 'parentComponent'
}).Class({
constructor: [app.material.MdDialog, function(dialog) {
var _this = this;
_this.dialog = dialog;
}],
openDialog: function() {
var _this = this;
var reference = _this.dialog.open(' ? what goes here?');
}
});
var dialogComponent = ng.core.Component({
selector: 'dialogComponent',
templateUrl: '/dialogComponent.html'
}).Class({
constructor: [ng.material.MdDialogRef, function(dialogRef) {
var _this = this;
_this.dialogRef = dialogRef;
// why do we need dialog ref at all?
}]
});
And when we call _this.dialog.open
, we run into this error:
caused by: No component factory found for [object Object]. Did you add it to @NgModule.entryComponents?
We cannot find a working example MdDialog
and we also cannot solve this problem. Who can help?
+3
source to share
No one has answered this question yet
Check out similar questions: