Skip to content

Commit 4044645

Browse files
committed
fix: lint and aot errors
1 parent 73d7a46 commit 4044645

File tree

5 files changed

+45
-38
lines changed

5 files changed

+45
-38
lines changed
Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,30 @@
1-
/**
2-
* @license
3-
* Copyright Google Inc. All Rights Reserved.
4-
*
5-
* Use of this source code is governed by an MIT-style license that can be
6-
* found in the LICENSE file at https://angular.io/license
7-
*/
8-
9-
import {Injector} from '@angular/core';
10-
11-
/**
12-
* Custom injector to be used when providing custom
13-
* injection tokens to components inside a portal.
14-
* @docs-private
15-
*/
16-
export class PortalInjector implements Injector {
17-
constructor(
18-
private _parentInjector: Injector,
19-
private _customTokens: WeakMap<any, any>) { }
20-
21-
get(token: any, notFoundValue?: any): any {
22-
const value = this._customTokens.get(token);
23-
24-
if (typeof value !== 'undefined') {
25-
return value;
26-
}
27-
28-
return this._parentInjector.get<any>(token, notFoundValue);
29-
}
30-
}
1+
/**
2+
* @license
3+
* Copyright Google Inc. All Rights Reserved.
4+
*
5+
* Use of this source code is governed by an MIT-style license that can be
6+
* found in the LICENSE file at https://angular.io/license
7+
*/
8+
9+
import {Injector} from '@angular/core';
10+
11+
/**
12+
* Custom injector to be used when providing custom
13+
* injection tokens to components inside a portal.
14+
* @docs-private
15+
*/
16+
export class PortalInjector implements Injector {
17+
constructor(
18+
private _parentInjector: Injector,
19+
private _customTokens: WeakMap<any, any>) { }
20+
21+
get(token: any, notFoundValue?: any): any {
22+
const value = this._customTokens.get(token);
23+
24+
if (typeof value !== 'undefined') {
25+
return value;
26+
}
27+
28+
return this._parentInjector.get<any>(token, notFoundValue);
29+
}
30+
}

src/lib/snack-bar/simple-snack-bar.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
*/
88

99
import {Component, ViewEncapsulation, Inject} from '@angular/core';
10-
import {MdSnackBarRef, MD_SNACK_BAR_DATA} from './index';
10+
import {MdSnackBarRef} from './snack-bar-ref';
11+
import {MD_SNACK_BAR_DATA} from './snack-bar-config';
1112

1213

1314
/**
@@ -25,9 +26,14 @@ import {MdSnackBarRef, MD_SNACK_BAR_DATA} from './index';
2526
}
2627
})
2728
export class SimpleSnackBar {
29+
/** Data that was injected into the snack bar. */
30+
data: { message: string, action: string };
31+
2832
constructor(
2933
public snackBarRef: MdSnackBarRef<SimpleSnackBar>,
30-
@Inject(MD_SNACK_BAR_DATA) public data: { message: string, action: string }) { }
34+
@Inject(MD_SNACK_BAR_DATA) data: any) {
35+
this.data = data;
36+
}
3137

3238
/** Dismisses the snack bar. */
3339
dismiss(): void {

src/lib/snack-bar/snack-bar-config.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,11 @@
66
* found in the LICENSE file at https://angular.io/license
77
*/
88

9-
import {ViewContainerRef} from '@angular/core';
9+
import {ViewContainerRef, InjectionToken} from '@angular/core';
1010
import {AriaLivePoliteness, Direction} from '../core';
1111

12+
export const MD_SNACK_BAR_DATA = new InjectionToken<any>('MdSnackBarData');
13+
1214
/**
1315
* Configuration used when opening a snack-bar.
1416
*/

src/lib/snack-bar/snack-bar-ref.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ import {Observable} from 'rxjs/Observable';
1111
import {Subject} from 'rxjs/Subject';
1212
import {MdSnackBarContainer} from './snack-bar-container';
1313

14-
// TODO(josephperrott): Implement onAction observable.
15-
1614
/**
1715
* Reference to a snack bar dispatched from the snack bar service.
1816
*/

src/lib/snack-bar/snack-bar.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import {
1212
Optional,
1313
SkipSelf,
1414
Injector,
15-
InjectionToken,
1615
} from '@angular/core';
1716
import {
1817
ComponentType,
@@ -23,10 +22,12 @@ import {
2322
LiveAnnouncer,
2423
} from '../core';
2524
import {PortalInjector} from '../core/portal/portal-injector';
26-
import {MdSnackBarConfig, MdSnackBarRef, MdSnackBarContainer, SimpleSnackBar} from './index';
2725
import {extendObject} from '../core/util/object-extend';
26+
import {MdSnackBarConfig, MD_SNACK_BAR_DATA} from './snack-bar-config';
27+
import {MdSnackBarRef} from './snack-bar-ref';
28+
import {MdSnackBarContainer} from './snack-bar-container';
29+
import {SimpleSnackBar} from './simple-snack-bar';
2830

29-
export const MD_SNACK_BAR_DATA = new InjectionToken<any>('MdSnackBarData');
3031

3132
/**
3233
* Service to dispatch Material Design snack bar messages.

0 commit comments

Comments
 (0)