diff --git a/package.json b/package.json
index 2f1d59714f5..44dfd924af0 100644
--- a/package.json
+++ b/package.json
@@ -62,7 +62,7 @@
"symlink-or-copy": "^1.0.1",
"ts-node": "^0.5.5",
"tslint": "^3.5.0",
- "typescript": "^1.7.5",
+ "typescript": "^1.8.0",
"typings": "^0.6.8",
"which": "^1.2.4"
}
diff --git a/src/components/button/button.spec.ts b/src/components/button/button.spec.ts
index 0db88952f4a..916fd15c2f4 100644
--- a/src/components/button/button.spec.ts
+++ b/src/components/button/button.spec.ts
@@ -1,13 +1,11 @@
-import {
- inject,
- TestComponentBuilder
-} from 'angular2/testing';
import {
it,
describe,
expect,
beforeEach,
-} from '../../core/facade/testing';
+ inject,
+ TestComponentBuilder
+} from 'angular2/testing';
import {Component} from 'angular2/core';
import {By} from 'angular2/platform/browser';
diff --git a/src/components/button/button.ts b/src/components/button/button.ts
index 7ea362b12c6..5e9bcd85ea4 100644
--- a/src/components/button/button.ts
+++ b/src/components/button/button.ts
@@ -8,7 +8,6 @@ import {
ElementRef,
Renderer,
} from 'angular2/core';
-import {TimerWrapper} from 'angular2/src/facade/async';
// TODO(jelbourn): Ink ripples.
// TODO(jelbourn): Make the `isMouseDown` stuff done with one global listener.
@@ -55,7 +54,7 @@ export class MdButton {
// button continues to look :active after clicking.
// @see http://marcysutton.com/button-focus-hell/
this.isMouseDown = true;
- TimerWrapper.setTimeout(() => { this.isMouseDown = false; }, 100);
+ setTimeout(() => { this.isMouseDown = false; }, 100);
}
_updateColor(newColor: string) {
diff --git a/src/components/card/card.ts b/src/components/card/card.ts
index 889c57fe653..6127fbd9cfe 100644
--- a/src/components/card/card.ts
+++ b/src/components/card/card.ts
@@ -1,5 +1,5 @@
import {Component, ViewEncapsulation, ChangeDetectionStrategy} from 'angular2/core';
-import {CONST_EXPR} from 'angular2/src/facade/lang';
+
/*
@@ -71,4 +71,4 @@ TODO(kara): update link to demo site when it exists
})
export class MdCardTitleGroup {}
-export const MD_CARD_DIRECTIVES: any[] = CONST_EXPR([MdCard, MdCardHeader, MdCardTitleGroup]);
+export const MD_CARD_DIRECTIVES: any[] = [MdCard, MdCardHeader, MdCardTitleGroup];
diff --git a/src/components/checkbox/checkbox.spec.ts b/src/components/checkbox/checkbox.spec.ts
index 4eb2a37a2a6..84a2fa126d4 100644
--- a/src/components/checkbox/checkbox.spec.ts
+++ b/src/components/checkbox/checkbox.spec.ts
@@ -1,18 +1,14 @@
import {
+ it,
+ describe,
+ expect,
+ beforeEach,
fakeAsync,
inject,
tick,
ComponentFixture,
TestComponentBuilder,
} from 'angular2/testing';
-
-import {
- it,
- describe,
- expect,
- beforeEach,
-} from '../../core/facade/testing';
-
import {Component, DebugElement, EventEmitter} from 'angular2/core';
import {By} from 'angular2/platform/browser';
diff --git a/src/components/checkbox/checkbox.ts b/src/components/checkbox/checkbox.ts
index 40c616adbef..43619673cd9 100644
--- a/src/components/checkbox/checkbox.ts
+++ b/src/components/checkbox/checkbox.ts
@@ -15,9 +15,6 @@ import {
NG_VALUE_ACCESSOR,
ControlValueAccessor
} from 'angular2/src/common/forms/directives/control_value_accessor';
-import {CONST_EXPR} from 'angular2/src/facade/lang';
-
-import { OneOf } from '../../core/annotations/one-of';
/**
* Monotonically increasing integer used to auto-generate unique ids for checkbox components.
@@ -28,11 +25,11 @@ let nextId = 0;
* Provider Expression that allows md-checkbox to register as a ControlValueAccessor. This allows it
* to support [(ngModel)] and ngControl.
*/
-const MD_CHECKBOX_CONTROL_VALUE_ACCESSOR = CONST_EXPR(new Provider(
+const MD_CHECKBOX_CONTROL_VALUE_ACCESSOR = new Provider(
NG_VALUE_ACCESSOR, {
useExisting: forwardRef(() => MdCheckbox),
multi: true
- }));
+ });
/**
* Represents the different states that require custom transitions between them.
@@ -93,7 +90,7 @@ export class MdCheckbox implements ControlValueAccessor {
@Input() id: string = `md-checkbox-${++nextId}`;
/** Whether or not the checkbox should come before or after the label. */
- @Input() @OneOf(['start', 'end']) align: string = 'start';
+ @Input() align: 'start' | 'end' = 'start';
/**
* Whether the checkbox is disabled. When the checkbox is disabled it cannot be interacted with.
diff --git a/src/components/input/input.spec.ts b/src/components/input/input.spec.ts
index 1cbd7268eec..ad61e8e307b 100644
--- a/src/components/input/input.spec.ts
+++ b/src/components/input/input.spec.ts
@@ -1,4 +1,7 @@
import {
+ it,
+ expect,
+ beforeEach,
fakeAsync,
inject,
ComponentFixture,
@@ -8,11 +11,6 @@ import {
} from 'angular2/testing';
import {Component} from 'angular2/core';
import {By} from 'angular2/platform/browser';
-import {
- it,
- expect,
- beforeEach,
-} from '../../core/facade/testing';
import {
MdInput,
MdInputDuplicatedHintException,
diff --git a/src/components/input/input.ts b/src/components/input/input.ts
index 9076f08e62c..bb44e0a10c6 100644
--- a/src/components/input/input.ts
+++ b/src/components/input/input.ts
@@ -12,28 +12,28 @@ import {
QueryList,
OnChanges,
} from 'angular2/core';
-import {CONST_EXPR, noop} from 'angular2/src/facade/lang';
import {
NG_VALUE_ACCESSOR,
ControlValueAccessor
} from 'angular2/src/common/forms/directives/control_value_accessor';
import {BaseException} from 'angular2/src/facade/exceptions';
import {BooleanFieldValue} from '../../core/annotations/field-value';
-import {OneOf} from '../../core/annotations/one-of';
-const MD_INPUT_CONTROL_VALUE_ACCESSOR = CONST_EXPR(new Provider(
+const noop = () => {};
+
+const MD_INPUT_CONTROL_VALUE_ACCESSOR = new Provider(
NG_VALUE_ACCESSOR, {
useExisting: forwardRef(() => MdInput),
multi: true
- }));
+ });
// Invalid input type. Using one of these will throw an MdInputUnsupportedTypeException.
-const MD_INPUT_INVALID_INPUT_TYPE = CONST_EXPR([
+const MD_INPUT_INVALID_INPUT_TYPE = [
'file',
'radio',
'checkbox',
-]);
+];
let nextUniqueId = 0;
@@ -81,7 +81,7 @@ export class MdPlaceholder {}
})
export class MdHint {
// Whether to align the hint label at the start or end of the line.
- @Input() @OneOf(['start', 'end']) align: string;
+ @Input() align: 'start' | 'end' = 'start';
}
@@ -129,9 +129,9 @@ export class MdInput implements ControlValueAccessor, AfterContentInit, OnChange
/**
* Bindings.
*/
- @Input() @OneOf(['start', 'end']) align: string = 'start';
+ @Input() align: 'start' | 'end' = 'start';
+ @Input() dividerColor: 'primary' | 'accent' | 'warn' = 'primary';
@Input() @BooleanFieldValue() disabled: boolean = false;
- @Input() @OneOf(['primary', 'accent', 'warn']) dividerColor: string = 'primary';
@Input() @BooleanFieldValue() floatingPlaceholder: boolean = true;
@Input() hintLabel: string = '';
@Input() id: string = `md-input-${nextUniqueId++}`;
@@ -234,8 +234,8 @@ export class MdInput implements ControlValueAccessor, AfterContentInit, OnChange
}
}
-export const MD_INPUT_DIRECTIVES: any[] = CONST_EXPR([
+export const MD_INPUT_DIRECTIVES: any[] = [
MdPlaceholder,
MdInput,
MdHint,
-]);
+];
diff --git a/src/components/list/list.spec.ts b/src/components/list/list.spec.ts
index 16654b3c99b..1d5ec794e1c 100644
--- a/src/components/list/list.spec.ts
+++ b/src/components/list/list.spec.ts
@@ -1,13 +1,11 @@
-import {
- inject,
- TestComponentBuilder
-} from 'angular2/testing';
import {
it,
describe,
expect,
beforeEach,
-} from '../../core/facade/testing';
+ inject,
+ TestComponentBuilder
+} from 'angular2/testing';
import {Component} from 'angular2/core';
import {By} from 'angular2/platform/browser';
diff --git a/src/components/list/list.ts b/src/components/list/list.ts
index b1bb308ed62..5914f50c0e8 100644
--- a/src/components/list/list.ts
+++ b/src/components/list/list.ts
@@ -1,6 +1,5 @@
import {Component, ViewEncapsulation, ContentChildren, ContentChild, QueryList, Directive,
ElementRef, Renderer, AfterContentInit} from 'angular2/core';
-import {CONST_EXPR} from 'angular2/src/facade/lang';
@Component({
selector: 'md-list',
@@ -60,4 +59,4 @@ export class MdListItem implements AfterContentInit {
}
}
-export const MD_LIST_DIRECTIVES: any[] = CONST_EXPR([MdList, MdListItem, MdLine, MdListAvatar]);
+export const MD_LIST_DIRECTIVES: any[] = [MdList, MdListItem, MdLine, MdListAvatar];
diff --git a/src/components/progress-circle/progress-circle.spec.ts b/src/components/progress-circle/progress-circle.spec.ts
index 2657590f0a7..dbf3a6d78bb 100644
--- a/src/components/progress-circle/progress-circle.spec.ts
+++ b/src/components/progress-circle/progress-circle.spec.ts
@@ -1,10 +1,10 @@
-import {inject, TestComponentBuilder} from 'angular2/testing';
import {
it,
describe,
expect,
beforeEach,
-} from '../../core/facade/testing';
+ inject,
+ TestComponentBuilder} from 'angular2/testing';
import {Component, DebugElement} from 'angular2/core';
import {By} from 'angular2/platform/browser';
import {MdProgressCircle} from './progress-circle';
@@ -30,18 +30,6 @@ export function main() {
});
});
- it('should apply mode of "determinate" if an invalid mode is provided.', (done: () => void) => {
- builder
- .overrideTemplate(TestApp, '')
- .createAsync(TestApp)
- .then((fixture) => {
- fixture.detectChanges();
- let progressElement = getChildDebugElement(fixture.debugElement, 'md-progress-circle');
- expect(progressElement.componentInstance.mode).toBe('determinate');
- done();
- });
- });
-
it('should not modify the mode if a valid mode is provided.', (done: () => void) => {
builder
.overrideTemplate(TestApp, '')
diff --git a/src/components/progress-circle/progress-circle.ts b/src/components/progress-circle/progress-circle.ts
index b3296dd07c4..5b0bc877d0f 100644
--- a/src/components/progress-circle/progress-circle.ts
+++ b/src/components/progress-circle/progress-circle.ts
@@ -4,20 +4,10 @@ import {
HostBinding,
Input
} from 'angular2/core';
-import {isPresent, CONST} from 'angular2/src/facade/lang';
-import {Math} from 'angular2/src/facade/math';
-import {OneOf} from '../../core/annotations/one-of';
// TODO(josephperrott): Benchpress tests.
-/** Display modes of Progress Circle */
-@CONST()
-class ProgressMode {
- @CONST() static DETERMINATE = 'determinate';
- @CONST() static INDETERMINATE = 'indeterminate';
-}
-
/**
* component.
@@ -51,9 +41,7 @@ export class MdProgressCircle {
* mode is bound to the host as the attribute host.
*/
@HostBinding('attr.mode')
- @Input()
- @OneOf([ProgressMode.DETERMINATE, ProgressMode.INDETERMINATE])
- mode: string;
+ @Input() mode: 'determinate' | 'indeterminate' = 'determinate';
/**
@@ -81,7 +69,7 @@ export class MdProgressCircle {
/** Sets the progress value, clamping before setting the internal value. */
set value(v: number) {
- if (isPresent(v)) {
+ if (v != null) {
this._value = MdProgressCircle.clamp(v);
}
}
@@ -113,6 +101,6 @@ export class MdProgressCircle {
export class MdSpinner extends MdProgressCircle {
constructor() {
super();
- this.mode = ProgressMode.INDETERMINATE;
+ this.mode = 'indeterminate';
}
}
diff --git a/src/components/radio/radio.spec.ts b/src/components/radio/radio.spec.ts
index 3296c5ea5fb..16464c68d36 100644
--- a/src/components/radio/radio.spec.ts
+++ b/src/components/radio/radio.spec.ts
@@ -1,15 +1,13 @@
-import {
- fakeAsync,
- inject,
- tick,
- TestComponentBuilder
-} from 'angular2/testing';
import {
it,
describe,
expect,
beforeEach,
-} from '../../core/facade/testing';
+ fakeAsync,
+ inject,
+ tick,
+ TestComponentBuilder
+} from 'angular2/testing';
import {Component, DebugElement} from 'angular2/core';
import {By} from 'angular2/platform/browser';
diff --git a/src/components/radio/radio.ts b/src/components/radio/radio.ts
index 1cbf1b43d7a..70aea7446a1 100644
--- a/src/components/radio/radio.ts
+++ b/src/components/radio/radio.ts
@@ -20,7 +20,6 @@ import {
NG_VALUE_ACCESSOR,
ControlValueAccessor
} from 'angular2/src/common/forms/directives/control_value_accessor';
-import {CONST_EXPR} from 'angular2/src/facade/lang';
import {MdRadioDispatcher} from './radio_dispatcher';
export {MdRadioDispatcher} from './radio_dispatcher';
@@ -29,11 +28,11 @@ export {MdRadioDispatcher} from './radio_dispatcher';
* Provider Expression that allows md-radio-group to register as a ControlValueAccessor. This
* allows it to support [(ngModel)] and ngControl.
*/
-const MD_RADIO_GROUP_CONTROL_VALUE_ACCESSOR = CONST_EXPR(new Provider(
+const MD_RADIO_GROUP_CONTROL_VALUE_ACCESSOR = new Provider(
NG_VALUE_ACCESSOR, {
useExisting: forwardRef(() => MdRadioGroup),
multi: true
- }));
+ });
// TODO(mtlin):
// Ink ripple is currently placeholder.
diff --git a/src/components/sidenav/sidenav.spec.ts b/src/components/sidenav/sidenav.spec.ts
index 4ac02e63177..a3e50fdcea3 100644
--- a/src/components/sidenav/sidenav.spec.ts
+++ b/src/components/sidenav/sidenav.spec.ts
@@ -1,4 +1,8 @@
import {
+ it,
+ describe,
+ expect,
+ beforeEach,
ComponentFixture,
TestComponentBuilder,
fakeAsync,
@@ -7,15 +11,6 @@ import {
tick
} from 'angular2/testing';
import {XHR} from 'angular2/src/compiler/xhr';
-import {
- it,
- describe,
- expect,
- beforeEach,
-} from '../../core/facade/testing';
-import {
- getComputedStyle
-} from '../../core/facade/html';
import {
Component,
ViewMetadata
diff --git a/src/components/sidenav/sidenav.ts b/src/components/sidenav/sidenav.ts
index 6063baa1783..e6e99460e34 100644
--- a/src/components/sidenav/sidenav.ts
+++ b/src/components/sidenav/sidenav.ts
@@ -11,14 +11,11 @@ import {
Output,
QueryList,
Type,
- ChangeDetectionStrategy
+ ChangeDetectionStrategy,
+ EventEmitter,
} from 'angular2/core';
-import {PromiseWrapper, ObservableWrapper, EventEmitter} from 'angular2/src/facade/async';
-import {iterateListLike} from 'angular2/src/facade/collection';
import {BaseException} from 'angular2/src/facade/exceptions';
-import {CONST_EXPR, isPresent} from 'angular2/src/facade/lang';
import {Dir} from '../../core/rtl/dir';
-import {OneOf} from '../../core/annotations/one-of';
import {PromiseCompleter} from 'angular2/src/facade/promise';
@@ -51,25 +48,25 @@ export class MdDuplicatedSidenavException extends BaseException {
})
export class MdSidenav {
/** Alignment of the sidenav (direction neutral); whether 'start' or 'end'. */
- @Input() @OneOf(['start', 'end']) align: string = 'start';
+ @Input() align: 'start' | 'end' = 'start';
/** Mode of the sidenav; whether 'over' or 'side'. */
- @Input() @OneOf(['over', 'push', 'side']) mode: string = 'over';
+ @Input() mode: 'over' | 'push' | 'side' = 'over';
/** Whether the sidenav is opened. */
@Input('opened') private _opened: boolean;
/** Event emitted when the sidenav is being opened. Use this to synchronize animations. */
- @Output('open-start') onOpenStart = new EventEmitter