Skip to content

Commit d19ec8f

Browse files
authored
Updated README.md with a solution
1 parent 88f99f7 commit d19ec8f

File tree

1 file changed

+22
-2
lines changed

1 file changed

+22
-2
lines changed

README.md

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,33 @@
11
# 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.
33

44
#### error
55
EXCEPTION: Cannot set property stack of [object Object] which has only a getter
66

77
If I replace the line regarding zone in package.json to: "zone.js": "0.7.2", i instead get:
88

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**
1010

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+
```
1131

1232
#### steps to reproduce
1333
1. `ng new my-dialog-app` - Create app

0 commit comments

Comments
 (0)