docs(snackbar): remove unnecessary viewContainerRef (#1803)

This commit is contained in:
Philippe MARTIN
2016-11-10 21:00:01 +01:00
committed by Jeremy Elbourn
parent 5a04ab6701
commit adfc4d1783
2 changed files with 4 additions and 7 deletions
+2 -3
View File
@@ -1,4 +1,4 @@
import {Component, ViewContainerRef} from '@angular/core';
import {Component} from '@angular/core';
import {MdSnackBar} from '@angular/material';
@Component({
@@ -12,8 +12,7 @@ export class SnackBarDemo {
action: boolean = false;
constructor(
public snackBar: MdSnackBar,
public viewContainerRef: ViewContainerRef) { }
public snackBar: MdSnackBar) { }
open() {
this.snackBar.open(this.message, this.action && this.actionButtonLabel);
+2 -4
View File
@@ -26,12 +26,10 @@ The service can be injected in a component.
})
export class MyComponent {
constructor(snackBar: MdSnackBar
viewContainerRef: ViewContainerRef) {}
constructor(snackBar: MdSnackBar) {}
failedAttempt() {
config = new MdSnackBarConfig(this.viewContainerRef);
this.snackBar.open('It didn\'t quite work!', 'Try Again', config);
this.snackBar.open('It didn\'t quite work!', 'Try Again');
}
}