docs(ts-to-js): ward's edits (incomplete)
This commit is contained in:
@@ -4,8 +4,7 @@ import { Component } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'hero-view',
|
||||
template:
|
||||
'<h1>Hero: {{getName()}}</h1>'
|
||||
template: '<h1>{{title}}: {{getName()}}</h1>'
|
||||
})
|
||||
// #docregion appexport
|
||||
// #docregion class
|
||||
|
||||
@@ -5,7 +5,7 @@ import { Component } from '@angular/core';
|
||||
// #docregion class
|
||||
// #docregion appexport
|
||||
export class HeroComponent {
|
||||
construct() {
|
||||
constructor() {
|
||||
this.title = 'Hero Detail';
|
||||
}
|
||||
getName() {return 'Windstorm'; }
|
||||
@@ -16,7 +16,7 @@ export class HeroComponent {
|
||||
HeroComponent.annotations = [
|
||||
new Component({
|
||||
selector: 'hero-view',
|
||||
template: '<h1>Hero: {{getName()}}</h1>'
|
||||
template: '<h1>{{title}}: {{getName()}}</h1>'
|
||||
})
|
||||
];
|
||||
// #enddocregion metadata
|
||||
|
||||
@@ -5,14 +5,13 @@
|
||||
// #docregion component
|
||||
var HeroComponent = ng.core.Component({
|
||||
selector: 'hero-view-2',
|
||||
template: '<h1>Name: {{getName()}}</h1>',
|
||||
template: '<h1>{{title}}: {{getName()}}</h1>',
|
||||
})
|
||||
.Class({
|
||||
constructor: function() {
|
||||
this.title = "Hero Detail";
|
||||
},
|
||||
getName: function() {
|
||||
return 'Windstorm';
|
||||
}
|
||||
getName: function() { return 'Windstorm'; }
|
||||
});
|
||||
// #enddocregion component
|
||||
|
||||
|
||||
@@ -9,19 +9,16 @@
|
||||
function HeroComponent() {
|
||||
this.title = "Hero Detail";
|
||||
}
|
||||
|
||||
HeroComponent.prototype.getName = function() { return 'Windstorm'; };
|
||||
// #enddocregion constructorproto
|
||||
|
||||
// #enddocregion appexport
|
||||
HeroComponent.annotations = [
|
||||
new ng.core.Component({
|
||||
selector: 'hero-view',
|
||||
template: '<h1>Hero: {{getName()}}</h1>'
|
||||
template: '<h1>{{title}}: {{getName()}}</h1>'
|
||||
})
|
||||
];
|
||||
// #docregion constructorproto
|
||||
|
||||
HeroComponent.prototype.getName = function() {return 'Windstorm';};
|
||||
// #enddocregion constructorproto
|
||||
// #enddocregion metadata
|
||||
|
||||
app.HeroesModule =
|
||||
|
||||
@@ -4,8 +4,7 @@ import { Component } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'hero-view',
|
||||
template:
|
||||
'<h1>Hero: {{getName()}}</h1>'
|
||||
template: '<h1>{{title}}: {{getName()}}</h1>'
|
||||
})
|
||||
// #docregion appexport
|
||||
// #docregion class
|
||||
|
||||
@@ -60,7 +60,7 @@
|
||||
|
||||
"ts-to-js": {
|
||||
"title": "TypeScript to JavaScript",
|
||||
"intro": "Convert Angular TypeScript examples into ES5 JavaScript",
|
||||
"intro": "Convert Angular TypeScript examples into ES6 and ES5 JavaScript",
|
||||
"hide": true
|
||||
},
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
|
||||
"ts-to-js": {
|
||||
"title": "TypeScript to JavaScript",
|
||||
"intro": "Convert Angular TypeScript examples into ES5 JavaScript"
|
||||
"intro": "Convert Angular TypeScript examples into ES6 and ES5 JavaScript"
|
||||
},
|
||||
|
||||
"visual-studio-2015": {
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -58,7 +58,7 @@
|
||||
|
||||
"ts-to-js": {
|
||||
"title": "TypeScript to JavaScript",
|
||||
"intro": "Convert Angular TypeScript examples into ES5 JavaScript"
|
||||
"intro": "Convert Angular TypeScript examples into ES6 and ES5 JavaScript"
|
||||
},
|
||||
|
||||
"visual-studio-2015": {
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -7,6 +7,12 @@ block includes
|
||||
The Angular documentation is a living document with continuous improvements.
|
||||
This log calls attention to recent significant changes.
|
||||
|
||||
## ES6 described in "TypeScript to JavaScript" (2016-11-03)
|
||||
The updated "[TypeScript to JavaScript](../cookbook/ts-to-js.html)" cookbook
|
||||
now explains how to write apps in ES6/7
|
||||
by translating the common idioms in the TypeScript documentation examples
|
||||
(and elsewhere on the web) to ES6/7 and ES5.
|
||||
|
||||
## Sync with Angular v.2.1.1 (2016-10-21)
|
||||
Docs and code samples updated and tested with Angular v.2.1.0
|
||||
|
||||
|
||||
Reference in New Issue
Block a user