Skip to content
This repository was archived by the owner on Dec 4, 2017. It is now read-only.

Commit 33b6197

Browse files
committed
docs(ts-to-js): ward's edits (incomplete)
1 parent 12eb19f commit 33b6197

File tree

11 files changed

+565
-510
lines changed

11 files changed

+565
-510
lines changed

public/docs/_examples/cb-ts-to-js/js-es6-decorators/app/hero.component.es6

+1-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ import { Component } from '@angular/core';
44

55
@Component({
66
selector: 'hero-view',
7-
template:
8-
'<h1>Hero: {{getName()}}</h1>'
7+
template: '<h1>{{title}}: {{getName()}}</h1>'
98
})
109
// #docregion appexport
1110
// #docregion class

public/docs/_examples/cb-ts-to-js/js-es6/app/hero.component.es6

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { Component } from '@angular/core';
55
// #docregion class
66
// #docregion appexport
77
export class HeroComponent {
8-
construct() {
8+
constructor() {
99
this.title = 'Hero Detail';
1010
}
1111
getName() {return 'Windstorm'; }
@@ -16,7 +16,7 @@ export class HeroComponent {
1616
HeroComponent.annotations = [
1717
new Component({
1818
selector: 'hero-view',
19-
template: '<h1>Hero: {{getName()}}</h1>'
19+
template: '<h1>{{title}}: {{getName()}}</h1>'
2020
})
2121
];
2222
// #enddocregion metadata

public/docs/_examples/cb-ts-to-js/js/app/hero-dsl.component.js

+3-4
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,13 @@
55
// #docregion component
66
var HeroComponent = ng.core.Component({
77
selector: 'hero-view-2',
8-
template: '<h1>Name: {{getName()}}</h1>',
8+
template: '<h1>{{title}}: {{getName()}}</h1>',
99
})
1010
.Class({
1111
constructor: function() {
12+
this.title = "Hero Detail";
1213
},
13-
getName: function() {
14-
return 'Windstorm';
15-
}
14+
getName: function() { return 'Windstorm'; }
1615
});
1716
// #enddocregion component
1817

public/docs/_examples/cb-ts-to-js/js/app/hero.component.js

+3-6
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,16 @@
99
function HeroComponent() {
1010
this.title = "Hero Detail";
1111
}
12-
12+
HeroComponent.prototype.getName = function() { return 'Windstorm'; };
1313
// #enddocregion constructorproto
14+
1415
// #enddocregion appexport
1516
HeroComponent.annotations = [
1617
new ng.core.Component({
1718
selector: 'hero-view',
18-
template: '<h1>Hero: {{getName()}}</h1>'
19+
template: '<h1>{{title}}: {{getName()}}</h1>'
1920
})
2021
];
21-
// #docregion constructorproto
22-
23-
HeroComponent.prototype.getName = function() {return 'Windstorm';};
24-
// #enddocregion constructorproto
2522
// #enddocregion metadata
2623

2724
app.HeroesModule =

public/docs/_examples/cb-ts-to-js/ts/app/hero.component.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ import { Component } from '@angular/core';
44

55
@Component({
66
selector: 'hero-view',
7-
template:
8-
'<h1>Hero: {{getName()}}</h1>'
7+
template: '<h1>{{title}}: {{getName()}}</h1>'
98
})
109
// #docregion appexport
1110
// #docregion class

public/docs/dart/latest/cookbook/_data.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060

6161
"ts-to-js": {
6262
"title": "TypeScript to JavaScript",
63-
"intro": "Convert Angular TypeScript examples into ES5 JavaScript",
63+
"intro": "Convert Angular TypeScript examples into ES6 and ES5 JavaScript",
6464
"hide": true
6565
},
6666

public/docs/js/latest/cookbook/_data.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555

5656
"ts-to-js": {
5757
"title": "TypeScript to JavaScript",
58-
"intro": "Convert Angular TypeScript examples into ES5 JavaScript"
58+
"intro": "Convert Angular TypeScript examples into ES6 and ES5 JavaScript"
5959
},
6060

6161
"visual-studio-2015": {

0 commit comments

Comments
 (0)