Skip to content

Commit adfc4d1

Browse files
feloyjelbourn
authored andcommitted
docs(snackbar): remove unnecessary viewContainerRef (#1803)
1 parent 5a04ab6 commit adfc4d1

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

src/demo-app/snack-bar/snack-bar-demo.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {Component, ViewContainerRef} from '@angular/core';
1+
import {Component} from '@angular/core';
22
import {MdSnackBar} from '@angular/material';
33

44
@Component({
@@ -12,8 +12,7 @@ export class SnackBarDemo {
1212
action: boolean = false;
1313

1414
constructor(
15-
public snackBar: MdSnackBar,
16-
public viewContainerRef: ViewContainerRef) { }
15+
public snackBar: MdSnackBar) { }
1716

1817
open() {
1918
this.snackBar.open(this.message, this.action && this.actionButtonLabel);

src/lib/snack-bar/README.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,10 @@ The service can be injected in a component.
2626
})
2727
export class MyComponent {
2828

29-
constructor(snackBar: MdSnackBar
30-
viewContainerRef: ViewContainerRef) {}
29+
constructor(snackBar: MdSnackBar) {}
3130

3231
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');
3533
}
3634

3735
}

0 commit comments

Comments
 (0)