refactor(LifecycleEvent): change from onInit to Lifecycle.onInit

BREAKING CHANGE

Closes #2928
This commit is contained in:
Misko Hevery
2015-07-04 15:04:50 +02:00
committed by Tobias Bosch
parent e1e7912ab2
commit b73ba68215
31 changed files with 245 additions and 250 deletions

View File

@ -1,4 +1,4 @@
import {Component, View, onChange} from 'angular2/angular2';
import {Component, View, LifecycleEvent} from 'angular2/angular2';
import {isPresent} from 'angular2/src/facade/lang';
@ -13,7 +13,7 @@ export class MdButton {
selector: '[md-button][href]',
properties: ['disabled'],
host: {'(click)': 'onClick($event)', '[tabIndex]': 'tabIndex'},
lifecycle: [onChange]
lifecycle: [LifecycleEvent.onChange]
})
@View({templateUrl: 'angular2_material/src/components/button/button.html'})
export class MdAnchor {

View File

@ -1,4 +1,4 @@
import {Component, View, Parent, onDestroy, onChange, onAllChangesDone} from 'angular2/angular2';
import {Component, View, Parent, LifecycleEvent} from 'angular2/angular2';
import {ListWrapper} from 'angular2/src/facade/collection';
import {StringWrapper, isPresent, isString, NumberWrapper} from 'angular2/src/facade/lang';
@ -14,7 +14,7 @@ import {Math} from 'angular2/src/facade/math';
@Component({
selector: 'md-grid-list',
properties: ['cols', 'rowHeight', 'gutterSize'],
lifecycle: [onAllChangesDone]
lifecycle: [LifecycleEvent.onAllChangesDone]
})
@View({templateUrl: 'angular2_material/src/components/grid_list/grid_list.html'})
export class MdGridList {
@ -221,7 +221,7 @@ export class MdGridList {
'[style.paddingTop]': 'stylePaddingTop',
'[attr.role]': '"listitem"'
},
lifecycle: [onDestroy, onChange]
lifecycle: [LifecycleEvent.onDestroy, LifecycleEvent.onChange]
})
@View({templateUrl: 'angular2_material/src/components/grid_list/grid_tile.html'})
export class MdGridTile {

View File

@ -1,4 +1,4 @@
import {Directive, onAllChangesDone, Attribute, Parent} from 'angular2/angular2';
import {Directive, LifecycleEvent, Attribute, Parent} from 'angular2/angular2';
import {ObservableWrapper, EventEmitter} from 'angular2/src/facade/async';
@ -9,7 +9,7 @@ import {ObservableWrapper, EventEmitter} from 'angular2/src/facade/async';
@Directive({
selector: 'md-input-container',
lifecycle: [onAllChangesDone],
lifecycle: [LifecycleEvent.onAllChangesDone],
host:
{'[class.md-input-has-value]': 'inputHasValue', '[class.md-input-focused]': 'inputHasFocus'}
})

View File

@ -1,11 +1,11 @@
import {Component, onChange, View, Attribute} from 'angular2/angular2';
import {Component, LifecycleEvent, View, Attribute} from 'angular2/angular2';
import {isPresent, isBlank} from 'angular2/src/facade/lang';
import {Math} from 'angular2/src/facade/math';
@Component({
selector: 'md-progress-linear',
lifecycle: [onChange],
lifecycle: [LifecycleEvent.onChange],
properties: ['value', 'bufferValue'],
host: {
'[attr.role]': '"progressbar"',

View File

@ -1,4 +1,12 @@
import {Component, View, onChange, Parent, Ancestor, Attribute, Optional} from 'angular2/angular2';
import {
Component,
View,
LifecycleEvent,
Parent,
Ancestor,
Attribute,
Optional
} from 'angular2/angular2';
import {isPresent, StringWrapper, NumberWrapper} from 'angular2/src/facade/lang';
import {ObservableWrapper, EventEmitter} from 'angular2/src/facade/async';
@ -24,7 +32,7 @@ var _uniqueIdCounter: number = 0;
@Component({
selector: 'md-radio-group',
lifecycle: [onChange],
lifecycle: [LifecycleEvent.onChange],
events: ['change'],
properties: ['disabled', 'value'],
host: {
@ -179,7 +187,7 @@ export class MdRadioGroup {
@Component({
selector: 'md-radio-button',
lifecycle: [onChange],
lifecycle: [LifecycleEvent.onChange],
properties: ['id', 'name', 'value', 'checked', 'disabled'],
host: {
'(keydown)': 'onKeydown($event)',