Skip to content

Commit d442798

Browse files
authored
fix(aot): add constant for a11y providers, use in core module (#1369)
1 parent 3045a05 commit d442798

File tree

6 files changed

+12
-11
lines changed

6 files changed

+12
-11
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"deploy": "firebase deploy",
1818
"webdriver-manager": "webdriver-manager"
1919
},
20-
"version": "2.0.0-alpha.9",
20+
"version": "2.0.0-alpha.9-2",
2121
"license": "MIT",
2222
"engines": {
2323
"node": ">= 4.2.1 < 5"

src/lib/core/a11y/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ export {FocusTrap} from './focus-trap';
77
export {MdLiveAnnouncer} from './live-announcer';
88
export {InteractivityChecker} from './interactivity-checker';
99

10+
export const A11Y_PROVIDERS = [MdLiveAnnouncer, InteractivityChecker];
1011

1112
@NgModule({
1213
declarations: [FocusTrap],
@@ -16,7 +17,7 @@ export class A11yModule {
1617
static forRoot(): ModuleWithProviders {
1718
return {
1819
ngModule: A11yModule,
19-
providers: [MdLiveAnnouncer, InteractivityChecker],
20+
providers: A11Y_PROVIDERS,
2021
};
2122
}
2223
}

src/lib/core/a11y/interactivity-checker.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import {Injectable} from '@angular/core';
2+
13
/**
24
* Utility for checking the interactivity of an element, such as whether is is focusable or
35
* tabbable.
@@ -11,6 +13,7 @@
1113
* TODO(jelbourn): explore using ally.js directly for its significantly more robust
1214
* checks (need to evaluate payload size, performance, and compatibility with tree-shaking).
1315
*/
16+
@Injectable()
1417
export class InteractivityChecker {
1518

1619
/** Gets whether an element is disabled. */

src/lib/core/core.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@ import {RtlModule} from './rtl/dir';
44
import {MdRippleModule} from './ripple/ripple';
55
import {PortalModule} from './portal/portal-directives';
66
import {OverlayModule} from './overlay/overlay-directives';
7-
import {A11yModule} from './a11y/index';
8-
import {MdLiveAnnouncer} from './a11y/live-announcer';
9-
import {InteractivityChecker} from './a11y/interactivity-checker';
7+
import {A11yModule, A11Y_PROVIDERS} from './a11y/index';
8+
import {OVERLAY_PROVIDERS} from './overlay/overlay';
109

1110

1211
// RTL
@@ -89,7 +88,7 @@ export class MdCoreModule {
8988
static forRoot(): ModuleWithProviders {
9089
return {
9190
ngModule: MdCoreModule,
92-
providers: [MdLiveAnnouncer, InteractivityChecker],
91+
providers: [A11Y_PROVIDERS, OVERLAY_PROVIDERS],
9392
};
9493
}
9594
}

src/lib/module.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import {NgModule, ModuleWithProviders} from '@angular/core';
22

33
import {
4-
MdLiveAnnouncer,
54
MdRippleModule,
65
RtlModule,
76
PortalModule,
8-
OverlayModule
7+
OverlayModule,
8+
A11yModule,
99
} from './core/index';
1010

1111
import {MdButtonToggleModule} from './button-toggle/index';
@@ -29,7 +29,6 @@ import {MdToolbarModule} from './toolbar/index';
2929
import {MdTooltipModule} from './tooltip/index';
3030
import {MdMenuModule} from './menu/index';
3131
import {MdDialogModule} from './dialog/index';
32-
import {A11yModule} from './core/a11y/index';
3332

3433

3534
const MATERIAL_MODULES = [
@@ -93,7 +92,6 @@ const MATERIAL_MODULES = [
9392
OverlayModule.forRoot(),
9493
],
9594
exports: MATERIAL_MODULES,
96-
providers: [MdLiveAnnouncer]
9795
})
9896
export class MaterialRootModule { }
9997

src/lib/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@angular/material",
3-
"version": "2.0.0-alpha.9",
3+
"version": "2.0.0-alpha.9-2",
44
"description": "Angular 2 Material",
55
"main": "./material.umd.js",
66
"module": "./index.js",

0 commit comments

Comments
 (0)