Skip to content

Commit c59dca1

Browse files
2 parents b1562b3 + d19ec8f commit c59dca1

File tree

1 file changed

+49
-1
lines changed

1 file changed

+49
-1
lines changed

README.md

Lines changed: 49 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,50 @@
11
# sample-angular-material-dialog-overview
2-
A basic sample showing how to use the md-dialog
2+
A basic sample showing how to use the Material Dialog in a newly generated Angular app.
3+
4+
#### error
5+
EXCEPTION: Cannot set property stack of [object Object] which has only a getter
6+
7+
If I replace the line regarding zone in package.json to: "zone.js": "0.7.2", i instead get:
8+
9+
**EXCEPTION: Error in :0:0 caused by: The selector "app-example-dialog" did not match any elements**
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+
```
31+
32+
#### steps to reproduce
33+
1. `ng new my-dialog-app` - Create app
34+
2. `cd my-dialog-app` - Go to app
35+
3. `ng generate component ExampleDialog` - Create a component for the dialog content
36+
4. Installed Material according to documentation:
37+
- `npm install --save @angular/material` - Install Material
38+
- Added to src/styles.css: `@import '~@angular/material/core/theming/prebuilt/deeppurple-amber.css';`
39+
- Added MaterialModule to AppModule.
40+
5. Changed app.component.html and app.component.ts following the [Dialog Overview Sample](https://material.angular.io/components/component/dialog).
41+
6. Added ExampleDialog to ngModule bootstrap, like so: `bootstrap: [AppComponent, ExampleDialogComponent]`.
42+
43+
44+
#### versions
45+
- Angular CLI: v1.0.0-beta.25.5
46+
- Node JS: v6.9.4
47+
- npm: 3.10.10
48+
- OS: Windows 10.0.14393 (x64)
49+
- Browser: Chrome 55.0.2883.87, Edge 38.14393.0.0
50+
- @angular/material": "^2.0.0-beta.1"

0 commit comments

Comments
 (0)