Skip to content

Commit 5f398d1

Browse files
committed
chore: remove facades and dart-specific patterns
1 parent e99da66 commit 5f398d1

36 files changed

+126
-1382
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
"symlink-or-copy": "^1.0.1",
6363
"ts-node": "^0.5.5",
6464
"tslint": "^3.5.0",
65-
"typescript": "^1.7.5",
65+
"typescript": "^1.8.0",
6666
"typings": "^0.6.8",
6767
"which": "^1.2.4"
6868
}

src/components/button/button.spec.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
1-
import {
2-
inject,
3-
TestComponentBuilder
4-
} from 'angular2/testing';
51
import {
62
it,
73
describe,
84
expect,
95
beforeEach,
10-
} from '../../core/facade/testing';
6+
inject,
7+
TestComponentBuilder
8+
} from 'angular2/testing';
119
import {Component} from 'angular2/core';
1210
import {By} from 'angular2/platform/browser';
1311

src/components/button/button.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import {
88
ElementRef,
99
Renderer,
1010
} from 'angular2/core';
11-
import {TimerWrapper} from 'angular2/src/facade/async';
1211

1312
// TODO(jelbourn): Ink ripples.
1413
// TODO(jelbourn): Make the `isMouseDown` stuff done with one global listener.
@@ -55,7 +54,7 @@ export class MdButton {
5554
// button continues to look :active after clicking.
5655
// @see http://marcysutton.com/button-focus-hell/
5756
this.isMouseDown = true;
58-
TimerWrapper.setTimeout(() => { this.isMouseDown = false; }, 100);
57+
setTimeout(() => { this.isMouseDown = false; }, 100);
5958
}
6059

6160
_updateColor(newColor: string) {

src/components/card/card.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import {Component, ViewEncapsulation, ChangeDetectionStrategy} from 'angular2/core';
2-
import {CONST_EXPR} from 'angular2/src/facade/lang';
2+
33

44
/*
55
@@ -71,4 +71,4 @@ TODO(kara): update link to demo site when it exists
7171
})
7272
export class MdCardTitleGroup {}
7373

74-
export const MD_CARD_DIRECTIVES: any[] = CONST_EXPR([MdCard, MdCardHeader, MdCardTitleGroup]);
74+
export const MD_CARD_DIRECTIVES: any[] = [MdCard, MdCardHeader, MdCardTitleGroup];

src/components/checkbox/checkbox.spec.ts

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,14 @@
11
import {
2+
it,
3+
describe,
4+
expect,
5+
beforeEach,
26
fakeAsync,
37
inject,
48
tick,
59
ComponentFixture,
610
TestComponentBuilder,
711
} from 'angular2/testing';
8-
9-
import {
10-
it,
11-
describe,
12-
expect,
13-
beforeEach,
14-
} from '../../core/facade/testing';
15-
1612
import {Component, DebugElement, EventEmitter} from 'angular2/core';
1713
import {By} from 'angular2/platform/browser';
1814

src/components/checkbox/checkbox.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@ import {
1515
NG_VALUE_ACCESSOR,
1616
ControlValueAccessor
1717
} from 'angular2/src/common/forms/directives/control_value_accessor';
18-
import {CONST_EXPR} from 'angular2/src/facade/lang';
19-
20-
import { OneOf } from '../../core/annotations/one-of';
2118

2219
/**
2320
* Monotonically increasing integer used to auto-generate unique ids for checkbox components.
@@ -28,11 +25,11 @@ let nextId = 0;
2825
* Provider Expression that allows md-checkbox to register as a ControlValueAccessor. This allows it
2926
* to support [(ngModel)] and ngControl.
3027
*/
31-
const MD_CHECKBOX_CONTROL_VALUE_ACCESSOR = CONST_EXPR(new Provider(
28+
const MD_CHECKBOX_CONTROL_VALUE_ACCESSOR = new Provider(
3229
NG_VALUE_ACCESSOR, {
3330
useExisting: forwardRef(() => MdCheckbox),
3431
multi: true
35-
}));
32+
});
3633

3734
/**
3835
* Represents the different states that require custom transitions between them.
@@ -93,7 +90,7 @@ export class MdCheckbox implements ControlValueAccessor {
9390
@Input() id: string = `md-checkbox-${++nextId}`;
9491

9592
/** Whether or not the checkbox should come before or after the label. */
96-
@Input() @OneOf(['start', 'end']) align: string = 'start';
93+
@Input() align: 'start' | 'end' = 'start';
9794

9895
/**
9996
* Whether the checkbox is disabled. When the checkbox is disabled it cannot be interacted with.

src/components/input/input.spec.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
import {
2+
it,
3+
expect,
4+
beforeEach,
25
fakeAsync,
36
inject,
47
ComponentFixture,
@@ -8,11 +11,6 @@ import {
811
} from 'angular2/testing';
912
import {Component} from 'angular2/core';
1013
import {By} from 'angular2/platform/browser';
11-
import {
12-
it,
13-
expect,
14-
beforeEach,
15-
} from '../../core/facade/testing';
1614
import {
1715
MdInput,
1816
MdInputDuplicatedHintException,

src/components/input/input.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,28 +12,28 @@ import {
1212
QueryList,
1313
OnChanges,
1414
} from 'angular2/core';
15-
import {CONST_EXPR, noop} from 'angular2/src/facade/lang';
1615
import {
1716
NG_VALUE_ACCESSOR,
1817
ControlValueAccessor
1918
} from 'angular2/src/common/forms/directives/control_value_accessor';
2019
import {BaseException} from 'angular2/src/facade/exceptions';
2120
import {BooleanFieldValue} from '../../core/annotations/field-value';
22-
import {OneOf} from '../../core/annotations/one-of';
2321

2422

25-
const MD_INPUT_CONTROL_VALUE_ACCESSOR = CONST_EXPR(new Provider(
23+
const noop = () => {};
24+
25+
const MD_INPUT_CONTROL_VALUE_ACCESSOR = new Provider(
2626
NG_VALUE_ACCESSOR, {
2727
useExisting: forwardRef(() => MdInput),
2828
multi: true
29-
}));
29+
});
3030

3131
// Invalid input type. Using one of these will throw an MdInputUnsupportedTypeException.
32-
const MD_INPUT_INVALID_INPUT_TYPE = CONST_EXPR([
32+
const MD_INPUT_INVALID_INPUT_TYPE = [
3333
'file',
3434
'radio',
3535
'checkbox',
36-
]);
36+
];
3737

3838

3939
let nextUniqueId = 0;
@@ -81,7 +81,7 @@ export class MdPlaceholder {}
8181
})
8282
export class MdHint {
8383
// Whether to align the hint label at the start or end of the line.
84-
@Input() @OneOf(['start', 'end']) align: string;
84+
@Input() align: 'start' | 'end' = 'start';
8585
}
8686

8787

@@ -129,9 +129,9 @@ export class MdInput implements ControlValueAccessor, AfterContentInit, OnChange
129129
/**
130130
* Bindings.
131131
*/
132-
@Input() @OneOf(['start', 'end']) align: string = 'start';
132+
@Input() align: 'start' | 'end' = 'start';
133+
@Input() dividerColor: 'primary' | 'accent' | 'warn' = 'primary';
133134
@Input() @BooleanFieldValue() disabled: boolean = false;
134-
@Input() @OneOf(['primary', 'accent', 'warn']) dividerColor: string = 'primary';
135135
@Input() @BooleanFieldValue() floatingPlaceholder: boolean = true;
136136
@Input() hintLabel: string = '';
137137
@Input() id: string = `md-input-${nextUniqueId++}`;
@@ -234,8 +234,8 @@ export class MdInput implements ControlValueAccessor, AfterContentInit, OnChange
234234
}
235235
}
236236

237-
export const MD_INPUT_DIRECTIVES: any[] = CONST_EXPR([
237+
export const MD_INPUT_DIRECTIVES: any[] = [
238238
MdPlaceholder,
239239
MdInput,
240240
MdHint,
241-
]);
241+
];

src/components/list/list.spec.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
1-
import {
2-
inject,
3-
TestComponentBuilder
4-
} from 'angular2/testing';
51
import {
62
it,
73
describe,
84
expect,
95
beforeEach,
10-
} from '../../core/facade/testing';
6+
inject,
7+
TestComponentBuilder
8+
} from 'angular2/testing';
119
import {Component} from 'angular2/core';
1210
import {By} from 'angular2/platform/browser';
1311

src/components/list/list.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import {Component, ViewEncapsulation, ContentChildren, ContentChild, QueryList, Directive,
22
ElementRef, Renderer, AfterContentInit} from 'angular2/core';
3-
import {CONST_EXPR} from 'angular2/src/facade/lang';
43

54
@Component({
65
selector: 'md-list',
@@ -60,4 +59,4 @@ export class MdListItem implements AfterContentInit {
6059
}
6160
}
6261

63-
export const MD_LIST_DIRECTIVES: any[] = CONST_EXPR([MdList, MdListItem, MdLine, MdListAvatar]);
62+
export const MD_LIST_DIRECTIVES: any[] = [MdList, MdListItem, MdLine, MdListAvatar];

0 commit comments

Comments
 (0)