diff --git a/src/lib/core/portal/portal-injector.ts b/src/lib/core/portal/portal-injector.ts index 5e6a58f3b887..98945fa75299 100644 --- a/src/lib/core/portal/portal-injector.ts +++ b/src/lib/core/portal/portal-injector.ts @@ -1,30 +1,30 @@ -/** - * @license - * Copyright Google Inc. All Rights Reserved. - * - * Use of this source code is governed by an MIT-style license that can be - * found in the LICENSE file at https://angular.io/license - */ - -import {Injector} from '@angular/core'; - -/** - * Custom injector to be used when providing custom - * injection tokens to components inside a portal. - * @docs-private - */ -export class PortalInjector implements Injector { - constructor( - private _parentInjector: Injector, - private _customTokens: WeakMap) { } - - get(token: any, notFoundValue?: any): any { - const value = this._customTokens.get(token); - - if (typeof value !== 'undefined') { - return value; - } - - return this._parentInjector.get(token, notFoundValue); - } -} +/** + * @license + * Copyright Google Inc. All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.io/license + */ + +import {Injector} from '@angular/core'; + +/** + * Custom injector to be used when providing custom + * injection tokens to components inside a portal. + * @docs-private + */ +export class PortalInjector implements Injector { + constructor( + private _parentInjector: Injector, + private _customTokens: WeakMap) { } + + get(token: any, notFoundValue?: any): any { + const value = this._customTokens.get(token); + + if (typeof value !== 'undefined') { + return value; + } + + return this._parentInjector.get(token, notFoundValue); + } +} diff --git a/src/lib/snack-bar/simple-snack-bar.ts b/src/lib/snack-bar/simple-snack-bar.ts index 37eb2d185d02..57c1784e2459 100644 --- a/src/lib/snack-bar/simple-snack-bar.ts +++ b/src/lib/snack-bar/simple-snack-bar.ts @@ -25,9 +25,14 @@ import {MdSnackBarRef, MD_SNACK_BAR_DATA} from './index'; } }) export class SimpleSnackBar { + /** Data that was injected into the snack bar. */ + data: { message: string, action: string }; + constructor( public snackBarRef: MdSnackBarRef, - @Inject(MD_SNACK_BAR_DATA) public data: { message: string, action: string }) { } + @Inject(MD_SNACK_BAR_DATA) data: any) { + this.data = data; + } /** Dismisses the snack bar. */ dismiss(): void {