diff --git a/CHANGELOG.md b/CHANGELOG.md index ba7275a023..9d2f9c6400 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -54,7 +54,25 @@ #### Lifecycle -* Before +* Before (ES5) + +```js +var HelloCmp = ng. + Component({ + selector: 'hello-cmp', + lifecycle: [LifecycleEvent.onInit] + }) + .View({ + template: `

hello, there!

` + }) + .Class({ + onInit: function() { + console.log('hello-cmp init'); + } + }); +``` + +* Before (ES6) ```js import {Component, View, LifecycleEvent} from 'angular2/angular2'; @@ -66,7 +84,6 @@ import {Component, View, LifecycleEvent} from 'angular2/angular2'; @View({ template: `

hello, there!

` }) - class HelloCmp { onInit() { console.log('hello-cmp init'); @@ -74,7 +91,24 @@ class HelloCmp { } ``` -* After +* After (ES5) + +```js +var HelloCmp = ng. + Component({ + selector: 'hello-cmp' + }) + .View({ + template: `

hello, there!

` + }) + .Class({ + onInit: function() { + console.log('hello-cmp init'); + } + }); +``` + +* After (ES6) ```js import {Component, View, OnInit} from 'angular2/angular2'; @@ -85,7 +119,6 @@ import {Component, View, OnInit} from 'angular2/angular2'; @View({ template: `

hello, there!

` }) - class HelloCmp implements OnInit { onInit() { console.log('hello-cmp init'); @@ -93,6 +126,7 @@ class HelloCmp implements OnInit { } ``` + # 2.0.0-alpha.36 (2015-08-31)