chore(LifecycleEvent): change to PascalCase / rename

BREAKING CHANGE

Closes #3863

- LifecycleEvent.onInit => LifecycleEvent.OnInit
- LifecycleEvent.onDestroy => LifecycleEvent.OnDestroy
- LifecycleEvent.onChange => LifecycleEvent.OnChanges
- LifecycleEvent.onCheck => LifecycleEvent.DoCheck
- LifecycleEvent.onAllChangesDone => LifecycleEvent.AfterContentChecked
- OnCheck.onCheck() => DoCheck.doCheck()
- OnChange.onChange() => OnChanges.onChanges()
- OnAllChangesDone.onAllChangesDone() => AfterContentChecked.afterContentChecked

Closes #3851
This commit is contained in:
Misko Hevery
2015-08-27 21:19:56 -07:00
parent ac3f5106e4
commit 551d9a1688
64 changed files with 492 additions and 487 deletions

View File

@ -48,7 +48,7 @@ export class MdButton {
@Component({
selector: 'a[md-button], a[md-raised-button], a[md-fab]',
properties: ['disabled'],
lifecycle: [LifecycleEvent.onChange],
lifecycle: [LifecycleEvent.OnChanges],
host: {
'(^click)': 'onClick($event)',
'(^mousedown)': 'onMousedown()',
@ -86,7 +86,7 @@ export class MdAnchor extends MdButton {
}
/** Invoked when a change is detected. */
onChange(_) {
onChanges(_) {
// A disabled anchor should not be in the tab flow.
this.tabIndex = this.disabled ? -1 : 0;
}

View File

@ -28,7 +28,7 @@ class RowHeightMode {
@Component({
selector: 'md-grid-list',
properties: ['cols', 'rowHeight', 'gutterSize'],
lifecycle: [LifecycleEvent.onAllChangesDone]
lifecycle: [LifecycleEvent.AfterContentChecked]
})
@View({
templateUrl: 'package:angular2_material/src/components/grid_list/grid_list.html',
@ -88,7 +88,7 @@ export class MdGridList {
}
}
onAllChangesDone() {
afterContentChecked() {
this.layoutTiles();
}
@ -226,7 +226,7 @@ export class MdGridList {
'[style.marginTop]': 'style.marginTop',
'[style.paddingTop]': 'style.paddingTop',
},
lifecycle: [LifecycleEvent.onDestroy, LifecycleEvent.onChange]
lifecycle: [LifecycleEvent.OnDestroy, LifecycleEvent.OnChanges]
})
@View({
templateUrl: 'package:angular2_material/src/components/grid_list/grid_tile.html',
@ -269,7 +269,7 @@ export class MdGridTile {
* Change handler invoked when bindings are resolved or when bindings have changed.
* Notifies grid-list that a re-layout is required.
*/
onChange(_) {
onChanges(_) {
if (!this.isRegisteredWithGridList) {
this.gridList.addTile(this);
this.isRegisteredWithGridList = true;

View File

@ -9,7 +9,7 @@ import {ObservableWrapper, EventEmitter} from 'angular2/src/core/facade/async';
@Directive({
selector: 'md-input-container',
lifecycle: [LifecycleEvent.onAllChangesDone],
lifecycle: [LifecycleEvent.AfterContentChecked],
host: {
'[class.md-input-has-value]': 'inputHasValue',
'[class.md-input-focused]': 'inputHasFocus',
@ -31,7 +31,7 @@ export class MdInputContainer {
this.inputHasFocus = false;
}
onAllChangesDone() {
afterContentChecked() {
// Enforce that this directive actually contains a text input.
if (this._input == null) {
throw 'No <input> or <textarea> found inside of <md-input-container>';

View File

@ -15,7 +15,7 @@ class ProgressMode {
@Component({
selector: 'md-progress-linear',
lifecycle: [LifecycleEvent.onChange],
lifecycle: [LifecycleEvent.OnChanges],
properties: ['value', 'bufferValue'],
host: {
'role': 'progressbar',
@ -62,7 +62,7 @@ export class MdProgressLinear {
}
}
onChange(_) {
onChanges(_) {
// If the mode does not use a value, or if there is no value, do nothing.
if (this.mode == ProgressMode.QUERY || this.mode == ProgressMode.INDETERMINATE ||
isBlank(this.value)) {

View File

@ -33,7 +33,7 @@ var _uniqueIdCounter: number = 0;
@Component({
selector: 'md-radio-group',
lifecycle: [LifecycleEvent.onChange],
lifecycle: [LifecycleEvent.OnChanges],
events: ['change'],
properties: ['disabled', 'value'],
host: {
@ -103,7 +103,7 @@ export class MdRadioGroup {
}
/** Change handler invoked when bindings are resolved or when bindings have changed. */
onChange(_) {
onChanges(_) {
// If the component has a disabled attribute with no value, it will set disabled = ''.
this.disabled = isPresent(this.disabled) && this.disabled !== false;
@ -191,7 +191,7 @@ export class MdRadioGroup {
@Component({
selector: 'md-radio-button',
lifecycle: [LifecycleEvent.onInit],
lifecycle: [LifecycleEvent.OnInit],
properties: ['id', 'name', 'value', 'checked', 'disabled'],
host: {
'role': 'radio',