File tree Expand file tree Collapse file tree 2 files changed +4
-7
lines changed Expand file tree Collapse file tree 2 files changed +4
-7
lines changed Original file line number Diff line number Diff line change 1
- import { Component , ViewContainerRef } from '@angular/core' ;
1
+ import { Component } from '@angular/core' ;
2
2
import { MdSnackBar } from '@angular/material' ;
3
3
4
4
@Component ( {
@@ -12,8 +12,7 @@ export class SnackBarDemo {
12
12
action : boolean = false ;
13
13
14
14
constructor (
15
- public snackBar : MdSnackBar ,
16
- public viewContainerRef : ViewContainerRef ) { }
15
+ public snackBar : MdSnackBar ) { }
17
16
18
17
open ( ) {
19
18
this . snackBar . open ( this . message , this . action && this . actionButtonLabel ) ;
Original file line number Diff line number Diff line change @@ -26,12 +26,10 @@ The service can be injected in a component.
26
26
})
27
27
export class MyComponent {
28
28
29
- constructor (snackBar : MdSnackBar
30
- viewContainerRef : ViewContainerRef ) {}
29
+ constructor (snackBar : MdSnackBar ) {}
31
30
32
31
failedAttempt() {
33
- config = new MdSnackBarConfig (this .viewContainerRef );
34
- this .snackBar .open (' It didn\' t quite work!' , ' Try Again' , config );
32
+ this .snackBar .open (' It didn\' t quite work!' , ' Try Again' );
35
33
}
36
34
37
35
}
You can’t perform that action at this time.
0 commit comments