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

Commit 5f91c73

Browse files
committed
docs(component-styles): new guide chapter - ward's tweaks
1 parent 5f3232a commit 5f91c73

File tree

12 files changed

+210
-184
lines changed

12 files changed

+210
-184
lines changed

public/docs/_examples/component-styles/ts/app/hero-app-main.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ import {QuestSummaryComponent} from './quest-summary.component';
1515
directives: [HeroDetailsComponent, HeroControlsComponent, QuestSummaryComponent]
1616
})
1717
export class HeroAppMainComponent {
18-
@Input() hero:Hero;
18+
@Input() hero: Hero;
1919
}

public/docs/_examples/component-styles/ts/app/hero-app.component.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,12 @@ import {HeroAppMainComponent} from './hero-app-main.component';
77
selector: 'hero-app',
88
template: `
99
<h1>Tour of Heroes</h1>
10-
<hero-app-main [hero]=hero></hero-app-main>
11-
`,
12-
styles: [`
13-
h1 { font-weight: normal; }
14-
`],
10+
<hero-app-main [hero]=hero></hero-app-main>`,
11+
styles: ['h1 { font-weight: normal; }'],
1512
directives: [HeroAppMainComponent]
1613
})
17-
export class HeroAppComponent {
1814
// #enddocregion
15+
export class HeroAppComponent {
1916
hero = new Hero(
2017
'Human Torch',
2118
['Mister Fantastic', 'Invisible Woman', 'Thing']

public/docs/_examples/component-styles/ts/app/hero-controls.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ import {Hero} from './hero';
1515
<button (click)="activate()">Activate</button>
1616
`
1717
})
18-
export class HeroControlsComponent {
1918
// #enddocregion inlinestyles
19+
export class HeroControlsComponent {
2020

21-
@Input() hero:Hero;
21+
@Input() hero: Hero;
2222

2323
activate() {
2424
this.hero.active = true;

public/docs/_examples/component-styles/ts/app/hero-team.component.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,9 @@ import {Hero} from './hero';
1111
<li *ngFor="#member of hero.team">
1212
{{member}}
1313
</li>
14-
</ul>
15-
`
14+
</ul>`
1615
})
17-
export class HeroTeamComponent {
1816
// #enddocregion stylelink
19-
20-
@Input() hero:Hero;
17+
export class HeroTeamComponent {
18+
@Input() hero: Hero;
2119
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
No quests in progress

public/docs/_examples/component-styles/ts/app/quest-summary.component.ts

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,28 @@ import {Component, ViewEncapsulation} from 'angular2/core';
55
// Let TypeScript know about the special SystemJS __moduleName variable
66
declare var __moduleName: string;
77
// #enddocregion
8-
// moduleName doesn't work on Plunkr, set it explicitly
8+
// moduleName is not set in some module loaders; set it explicitly
99
if (!__moduleName) {
1010
__moduleName = `http://${location.host}/${location.pathname}/app/`;
1111
}
12+
console.log(`The __moduleName is ${__moduleName} `);
1213
// #docregion
1314

1415
@Component({
1516
moduleId: __moduleName,
1617
selector: 'quest-summary',
17-
template: 'No quests ongoing',
18-
styleUrls: ['quest-summary.component.css'],
18+
// #docregion urls
19+
templateUrl: 'quest-summary.component.html',
20+
styleUrls: ['quest-summary.component.css']
21+
// #enddocregion urls
22+
// #enddocregion
23+
/*
24+
// #docregion encapsulation.native
25+
// warning: few browsers support shadow DOM encapsulation at this time
26+
encapsulation: ViewEncapsulation.Native
27+
// #enddocregion encapsulation.native
28+
*/
29+
// #docregion
1930
})
20-
export class QuestSummaryComponent {
21-
22-
}
31+
export class QuestSummaryComponent { }
2332
// #enddocregion

public/docs/_examples/component-styles/ts/app/quest-summary.native.component.css

Lines changed: 0 additions & 12 deletions
This file was deleted.

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,11 @@
6262
"intro": "Attribute directives attach behavior to elements."
6363
},
6464

65+
"component-styles": {
66+
"title": "Component Styles",
67+
"intro": "Learn how to apply CSS styles to components."
68+
},
69+
6570
"hierarchical-dependency-injection": {
6671
"title": "Hierarchical Dependency Injectors",
6772
"navTitle": "Hierarchical Injectors",
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
!= partial("../../../_includes/_ts-temp")

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,11 @@
6262
"intro": "Attribute directives attach behavior to elements."
6363
},
6464

65+
"component-styles": {
66+
"title": "Component Styles",
67+
"intro": "Learn how to apply CSS styles to components."
68+
},
69+
6570
"hierarchical-dependency-injection": {
6671
"title": "Hierarchical Dependency Injectors",
6772
"navTitle": "Hierarchical Injectors",
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
!= partial("../../../_includes/_ts-temp")

0 commit comments

Comments
 (0)