Skip to content

Commit acd9505

Browse files
committed
Update CDK to new API
1 parent eba7cd0 commit acd9505

20 files changed

+62
-85
lines changed

package-lock.json

Lines changed: 23 additions & 37 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@
2626
"node": ">= 5.4.1"
2727
},
2828
"dependencies": {
29-
"@angular/animations": ">=6.0.0-beta.7 <7.0.0",
30-
"@angular/common": ">=6.0.0-beta.7 <7.0.0",
31-
"@angular/compiler": ">=6.0.0-beta.7 <7.0.0",
32-
"@angular/core": ">=6.0.0-beta.7 <7.0.0",
33-
"@angular/forms": ">=6.0.0-beta.7 <7.0.0",
34-
"@angular/platform-browser": ">=6.0.0-beta.7 <7.0.0",
29+
"@angular/animations": "[email protected]:angular/animations-builds#6.0.0-beta.7+112431d",
30+
"@angular/common": "[email protected]:angular/common-builds#6.0.0-beta.7+112431d",
31+
"@angular/compiler": "[email protected]:angular/compiler-builds#6.0.0-beta.7+112431d",
32+
"@angular/core": "[email protected]:angular/core-builds#6.0.0-beta.7+112431d",
33+
"@angular/forms": "[email protected]:angular/forms-builds#6.0.0-beta.7+112431d",
34+
"@angular/platform-browser": "[email protected]:angular/platform-browser-builds#6.0.0-beta.7+112431d",
3535
"core-js": "^2.4.1",
3636
"rxjs": "^5.5.7",
3737
"systemjs": "0.19.43",
@@ -42,11 +42,11 @@
4242
"devDependencies": {
4343
"@angular-devkit/core": "^0.4.5",
4444
"@angular-devkit/schematics": "^0.4.5",
45-
"@angular/bazel": ">=6.0.0-beta.7 <7.0.0",
46-
"@angular/compiler-cli": ">=6.0.0-beta.7 <7.0.0",
47-
"@angular/http": ">=6.0.0-beta.7 <7.0.0",
48-
"@angular/platform-browser-dynamic": ">=6.0.0-beta.7 <7.0.0",
49-
"@angular/platform-server": ">=6.0.0-beta.7 <7.0.0",
45+
"@angular/bazel": "[email protected]:angular/bazel-builds#6.0.0-beta.7+112431d",
46+
"@angular/compiler-cli": "[email protected]:angular/compiler-cli-builds#6.0.0-beta.7+112431d",
47+
"@angular/http": "[email protected]:angular/http-builds#6.0.0-beta.7+112431d",
48+
"@angular/platform-browser-dynamic": "[email protected]:angular/platform-browser-dynamic-builds#6.0.0-beta.7+112431d",
49+
"@angular/platform-server": "[email protected]:angular/platform-server-builds#6.0.0-beta.7+112431d",
5050
"@angular/router": ">=6.0.0-beta.7 <7.0.0",
5151
"@angular/upgrade": "^5.0.1",
5252
"@bazel/ibazel": "0.3.1",
@@ -126,7 +126,7 @@
126126
"tsconfig-paths": "^2.3.0",
127127
"tslint": "^5.9.1",
128128
"tsutils": "^2.6.0",
129-
"typescript": "~2.6.0",
129+
"typescript": "~2.7.0",
130130
"uglify-js": "^2.8.14",
131131
"web-animations-js": "^2.2.5"
132132
}

src/cdk/a11y/aria-describer/aria-describer.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
import {DOCUMENT} from '@angular/common';
1010
import {
11-
APP_ROOT_SCOPE,
1211
Inject,
1312
Injectable,
1413
InjectionToken,
@@ -54,7 +53,7 @@ let messagesContainer: HTMLElement | null = null;
5453
* content.
5554
* @docs-private
5655
*/
57-
@Injectable({scope: APP_ROOT_SCOPE})
56+
@Injectable({providedIn: 'root'})
5857
export class AriaDescriber {
5958
private _document: Document;
6059

src/cdk/a11y/focus-monitor/focus-monitor.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
import {Platform, supportsPassiveEventListeners} from '@angular/cdk/platform';
1010
import {
11-
APP_ROOT_SCOPE,
1211
Directive,
1312
ElementRef,
1413
EventEmitter,
@@ -41,7 +40,7 @@ type MonitoredElementInfo = {
4140

4241

4342
/** Monitors mouse and keyboard events to determine the cause of focus events. */
44-
@Injectable({scope: APP_ROOT_SCOPE})
43+
@Injectable({providedIn: 'root'})
4544
export class FocusMonitor implements OnDestroy {
4645
/** The focus origin that the next focus event is a result of. */
4746
private _origin: FocusOrigin = null;

src/cdk/a11y/focus-trap/focus-trap.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import {coerceBooleanProperty} from '@angular/cdk/coercion';
1010
import {DOCUMENT} from '@angular/common';
1111
import {
1212
AfterContentInit,
13-
APP_ROOT_SCOPE,
1413
Directive,
1514
ElementRef,
1615
Inject,
@@ -279,7 +278,7 @@ export class FocusTrap {
279278

280279

281280
/** Factory that allows easy instantiation of focus traps. */
282-
@Injectable({scope: APP_ROOT_SCOPE})
281+
@Injectable({providedIn: 'root'})
283282
export class FocusTrapFactory {
284283
private _document: Document;
285284

src/cdk/a11y/interactivity-checker/interactivity-checker.ts

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

99
import {Platform} from '@angular/cdk/platform';
10-
import {APP_ROOT_SCOPE, Injectable} from '@angular/core';
10+
import {Injectable} from '@angular/core';
1111

1212

1313
// The InteractivityChecker leans heavily on the ally.js accessibility utilities.
@@ -18,7 +18,7 @@ import {APP_ROOT_SCOPE, Injectable} from '@angular/core';
1818
* Utility for checking the interactivity of an element, such as whether is is focusable or
1919
* tabbable.
2020
*/
21-
@Injectable({scope: APP_ROOT_SCOPE})
21+
@Injectable({providedIn: 'root'})
2222
export class InteractivityChecker {
2323

2424
constructor(private _platform: Platform) {}

src/cdk/a11y/live-announcer/live-announcer-token.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66
* found in the LICENSE file at https://angular.io/license
77
*/
88

9-
import {APP_ROOT_SCOPE, InjectionToken} from '@angular/core';
9+
import {InjectionToken} from '@angular/core';
1010

1111
// The token for the live announcer element is defined in a separate file from LiveAnnouncer
1212
// as a workaround for https://github.com/angular/angular/issues/22559
1313

1414
export const LIVE_ANNOUNCER_ELEMENT_TOKEN =
1515
new InjectionToken<HTMLElement | null>('liveAnnouncerElement', {
16-
scope: APP_ROOT_SCOPE,
16+
providedIn: 'root',
1717
factory: () => null,
1818
});

src/cdk/a11y/live-announcer/live-announcer.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
import {DOCUMENT} from '@angular/common';
1010
import {
11-
APP_ROOT_SCOPE,
1211
Inject,
1312
Injectable,
1413
OnDestroy,
@@ -22,7 +21,7 @@ import {LIVE_ANNOUNCER_ELEMENT_TOKEN} from './live-announcer-token';
2221
/** Possible politeness levels. */
2322
export type AriaLivePoliteness = 'off' | 'polite' | 'assertive';
2423

25-
@Injectable({scope: APP_ROOT_SCOPE})
24+
@Injectable({providedIn: 'root'})
2625
export class LiveAnnouncer implements OnDestroy {
2726
private readonly _liveElement: Element;
2827

src/cdk/bidi/dir-document-token.ts

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

99
import {DOCUMENT} from '@angular/common';
10-
import {APP_ROOT_SCOPE, inject, InjectionToken} from '@angular/core';
10+
import {inject, InjectionToken} from '@angular/core';
1111

1212

1313
/**
@@ -26,6 +26,6 @@ import {APP_ROOT_SCOPE, inject, InjectionToken} from '@angular/core';
2626
* @docs-private
2727
*/
2828
export const DIR_DOCUMENT = new InjectionToken<Document>('cdk-dir-doc', {
29-
scope: APP_ROOT_SCOPE,
29+
providedIn: 'root',
3030
factory: () => inject(DOCUMENT),
3131
});

src/cdk/bidi/directionality.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* found in the LICENSE file at https://angular.io/license
77
*/
88

9-
import {APP_ROOT_SCOPE, EventEmitter, Inject, Injectable, Optional} from '@angular/core';
9+
import {EventEmitter, Inject, Injectable, Optional} from '@angular/core';
1010
import {DIR_DOCUMENT} from './dir-document-token';
1111

1212

@@ -17,7 +17,7 @@ export type Direction = 'ltr' | 'rtl';
1717
* The directionality (LTR / RTL) context for the application (or a subtree of it).
1818
* Exposes the current direction and a stream of direction changes.
1919
*/
20-
@Injectable({scope: APP_ROOT_SCOPE})
20+
@Injectable({providedIn: 'root'})
2121
export class Directionality {
2222
/** The current 'ltr' or 'rtl' value. */
2323
readonly value: Direction = 'ltr';

src/cdk/collections/unique-selection-dispatcher.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* found in the LICENSE file at https://angular.io/license
77
*/
88

9-
import {APP_ROOT_SCOPE, Injectable, OnDestroy} from '@angular/core';
9+
import {Injectable, OnDestroy} from '@angular/core';
1010

1111

1212
// Users of the Dispatcher never need to see this type, but TypeScript requires it to be exported.
@@ -21,7 +21,7 @@ export type UniqueSelectionDispatcherListener = (id: string, name: string) => vo
2121
* This service does not *store* any IDs and names because they may change at any time, so it is
2222
* less error-prone if they are simply passed through when the events occur.
2323
*/
24-
@Injectable({scope: APP_ROOT_SCOPE})
24+
@Injectable({providedIn: 'root'})
2525
export class UniqueSelectionDispatcher implements OnDestroy {
2626
private _listeners: UniqueSelectionDispatcherListener[] = [];
2727

src/cdk/observers/observe-content.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
import {coerceBooleanProperty} from '@angular/cdk/coercion';
1010
import {
1111
AfterContentInit,
12-
APP_ROOT_SCOPE,
1312
Directive,
1413
ElementRef,
1514
EventEmitter,
@@ -30,7 +29,7 @@ import {Subject} from 'rxjs/Subject';
3029
* Factory that creates a new MutationObserver and allows us to stub it out in unit tests.
3130
* @docs-private
3231
*/
33-
@Injectable({scope: APP_ROOT_SCOPE})
32+
@Injectable({providedIn: 'root'})
3433
export class MutationObserverFactory {
3534
create(callback: MutationCallback): MutationObserver | null {
3635
return typeof MutationObserver === 'undefined' ? null : new MutationObserver(callback);

src/cdk/overlay/keyboard/overlay-keyboard-dispatcher.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
import {DOCUMENT} from '@angular/common';
1010
import {
11-
APP_ROOT_SCOPE,
1211
Inject,
1312
Injectable,
1413
InjectionToken,
@@ -24,7 +23,7 @@ import {OverlayRef} from '../overlay-ref';
2423
* if any. It maintains a list of attached overlays to determine best suited overlay based
2524
* on event target and order of overlay opens.
2625
*/
27-
@Injectable({scope: APP_ROOT_SCOPE})
26+
@Injectable({providedIn: 'root'})
2827
export class OverlayKeyboardDispatcher implements OnDestroy {
2928

3029
/** Currently attached overlays in the order they were attached. */

src/cdk/overlay/overlay-container.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
import {DOCUMENT} from '@angular/common';
1010
import {
11-
APP_ROOT_SCOPE,
1211
Inject,
1312
Injectable,
1413
InjectionToken,
@@ -19,7 +18,7 @@ import {
1918

2019

2120
/** Container inside which all overlays will render. */
22-
@Injectable({scope: APP_ROOT_SCOPE})
21+
@Injectable({providedIn: 'root'})
2322
export class OverlayContainer implements OnDestroy {
2423
protected _containerElement: HTMLElement;
2524

0 commit comments

Comments
 (0)