File tree Expand file tree Collapse file tree 1 file changed +22
-2
lines changed Expand file tree Collapse file tree 1 file changed +22
-2
lines changed Original file line number Diff line number Diff line change 1
1
# sample-angular-material-dialog-overview
2
- A basic sample showing an error received in the console when trying to show a basic md-dialog .
2
+ A basic sample showing how to use the Material Dialog in a newly generated Angular app .
3
3
4
4
#### error
5
5
EXCEPTION: Cannot set property stack of [ object Object] which has only a getter
6
6
7
7
If I replace the line regarding zone in package.json to: "zone.js": "0.7.2", i instead get:
8
8
9
- EXCEPTION: Error in :0:0 caused by: The selector "app-example-dialog" did not match any elements
9
+ ** EXCEPTION: Error in :0:0 caused by: The selector "app-example-dialog" did not match any elements**
10
10
11
+ ### solution
12
+ In app.module.ts, move ExampleDialog to entryComponents, like so:
13
+ ``` typescript
14
+ @NgModule ({
15
+ declarations: [
16
+ AppComponent ,
17
+ ExampleDialogComponent
18
+ ],
19
+ imports: [
20
+ BrowserModule ,
21
+ FormsModule ,
22
+ HttpModule ,
23
+ MaterialModule .forRoot ()
24
+ ],
25
+ providers: [],
26
+ bootstrap: [AppComponent ],
27
+ entryComponents: [ExampleDialogComponent ]
28
+ })
29
+ export class AppModule { }
30
+ ```
11
31
12
32
#### steps to reproduce
13
33
1 . ` ng new my-dialog-app ` - Create app
You can’t perform that action at this time.
0 commit comments