Skip to content

Commit 34bd636

Browse files
committed
remove use of new Provider(...)
1 parent c6c1dd0 commit 34bd636

File tree

5 files changed

+19
-24
lines changed

5 files changed

+19
-24
lines changed

src/components/button-toggle/button-toggle.ts

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,10 @@ import {
88
OnInit,
99
Optional,
1010
Output,
11-
Provider,
1211
QueryList,
1312
ViewEncapsulation,
1413
forwardRef
1514
} from '@angular/core';
16-
// TODO(iveysaur): Update to @angular/forms when we have rc.2
1715
import {
1816
NG_VALUE_ACCESSOR,
1917
ControlValueAccessor,
@@ -32,11 +30,11 @@ export type ToggleType = 'checkbox' | 'radio';
3230
* Provider Expression that allows md-button-toggle-group to register as a ControlValueAccessor.
3331
* This allows it to support [(ngModel)].
3432
*/
35-
export const MD_BUTTON_TOGGLE_GROUP_VALUE_ACCESSOR = new Provider(
36-
NG_VALUE_ACCESSOR, {
37-
useExisting: forwardRef(() => MdButtonToggleGroup),
38-
multi: true
39-
});
33+
export const MD_BUTTON_TOGGLE_GROUP_VALUE_ACCESSOR: any = {
34+
provide: NG_VALUE_ACCESSOR,
35+
useExisting: forwardRef(() => MdButtonToggleGroup),
36+
multi: true
37+
};
4038

4139
var _uniqueIdCounter = 0;
4240

src/components/checkbox/checkbox.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import {
55
EventEmitter,
66
Input,
77
Output,
8-
Provider,
98
Renderer,
109
ViewEncapsulation,
1110
forwardRef,
@@ -22,11 +21,11 @@ let nextId = 0;
2221
* Provider Expression that allows md-checkbox to register as a ControlValueAccessor. This allows it
2322
* to support [(ngModel)].
2423
*/
25-
export const MD_CHECKBOX_CONTROL_VALUE_ACCESSOR = new Provider(
26-
NG_VALUE_ACCESSOR, {
27-
useExisting: forwardRef(() => MdCheckbox),
28-
multi: true
29-
});
24+
export const MD_CHECKBOX_CONTROL_VALUE_ACCESSOR: any = {
25+
provide: NG_VALUE_ACCESSOR,
26+
useExisting: forwardRef(() => MdCheckbox),
27+
multi: true
28+
};
3029

3130
/**
3231
* Represents the different states that require custom transitions between them.

src/components/input/input.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import {
33
Component,
44
HostBinding,
55
Input,
6-
Provider,
76
Directive,
87
AfterContentInit,
98
ContentChild,
@@ -29,10 +28,11 @@ import {Observable} from 'rxjs/Observable';
2928

3029
const noop = () => {};
3130

32-
export const MD_INPUT_CONTROL_VALUE_ACCESSOR = new Provider(NG_VALUE_ACCESSOR, {
31+
export const MD_INPUT_CONTROL_VALUE_ACCESSOR: any = {
32+
provide: NG_VALUE_ACCESSOR,
3333
useExisting: forwardRef(() => MdInput),
3434
multi: true
35-
});
35+
};
3636

3737
// Invalid input type. Using one of these will throw an MdInputUnsupportedTypeError.
3838
const MD_INPUT_INVALID_INPUT_TYPE = [

src/components/radio/radio.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,9 @@ import {
99
OnInit,
1010
Optional,
1111
Output,
12-
Provider,
1312
QueryList,
1413
ViewEncapsulation,
15-
forwardRef
14+
forwardRef,
1615
} from '@angular/core';
1716
import {
1817
NG_VALUE_ACCESSOR,
@@ -34,11 +33,11 @@ export {
3433
* Provider Expression that allows md-radio-group to register as a ControlValueAccessor. This
3534
* allows it to support [(ngModel)] and ngControl.
3635
*/
37-
export const MD_RADIO_GROUP_CONTROL_VALUE_ACCESSOR = new Provider(
38-
NG_VALUE_ACCESSOR, {
39-
useExisting: forwardRef(() => MdRadioGroup),
40-
multi: true
41-
});
36+
export const MD_RADIO_GROUP_CONTROL_VALUE_ACCESSOR: any = {
37+
provide: NG_VALUE_ACCESSOR,
38+
useExisting: forwardRef(() => MdRadioGroup),
39+
multi: true
40+
};
4241

4342
// TODO(mtlin):
4443
// Ink ripple is currently placeholder.

src/core/overlay/position/connected-position-strategy.spec.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import {it, describe, expect, beforeEach} from '@angular/core/testing';
21
import {ElementRef} from '@angular/core';
32
import {ConnectedPositionStrategy} from './connected-position-strategy';
43
import {ViewportRuler} from './viewport-ruler';

0 commit comments

Comments
 (0)