0
親愛的#1社區,角2對話框那倒開放
我與angular2對話的問題,befor我給你在這裏的錯誤是我的代碼的snipet(我有exluced了很多,但我認爲他們可能不會在這裏很重要)
signup.component.ts文件:
import {Component, OnInit, NgZone, SimpleChanges} from '@angular/core';
import {MdDialog} from '@angular/material';
import template from './signup.component.html';
@Component({
selector: 'signup',
template
})
export class SignupComponent implements OnInit {
constructor(private router: Router, private zone: NgZone, private formBuilder: FormBuilder, public dialog: MdDialog) {
}
openDialog() {
this.dialog.open(DialogOverviewExampleDialog);
}
@Component({
selector: 'dialog-overview-example-dialog',
templateUrl: './dialog.html',
})
export class DialogOverviewExampleDialog {}
signup.component.html文件:
<h3 flex>Just<a (click)="openDialog()">Click here</a></h3>
和dialog.html:
<p>pls work</p>
我得到的控制檯上的錯誤在Chrome: 無元件廠發現DialogOverviewExampleDialog
這可能是我再次愚蠢,但我在哪裏可以找到entryComponents? –
傳遞給'@NgModule()'的對象。這通常在app.module.ts文件中。 –
非常感謝老兄:它工作。我太高興了 –