docs(toh-6): Move styles from sample.css to heroes.component.css
closes #1751 Move additional styles from `sample.css` to `hero-search.component.css`. Edit tutorial to reflect the removal of `sample.css` and the change to `heroes.component.css`. Edit tutorial to reflect the addition of `hero-search.component.css` file. Edit `hero-search.component.ts` to include styles from `hero-search.component.css`. Remove reference to `/public/docs/_examples/toh-6/ts/sample.css` from `/public/docs/_examples/toh-6/ts/index.html`.
This commit is contained in:
parent
b93fb12fea
commit
d26afa90fd
|
@ -1,11 +1,4 @@
|
||||||
/* #docregion */
|
/* #docregion */
|
||||||
.error {color:red;}
|
|
||||||
button.delete-button{
|
|
||||||
float:right;
|
|
||||||
background-color: gray !important;
|
|
||||||
color:white;
|
|
||||||
}
|
|
||||||
|
|
||||||
.search-result{
|
.search-result{
|
||||||
border-bottom: 1px solid gray;
|
border-bottom: 1px solid gray;
|
||||||
border-left: 1px solid gray;
|
border-left: 1px solid gray;
|
||||||
|
@ -21,4 +14,3 @@ button.delete-button{
|
||||||
width: 200px;
|
width: 200px;
|
||||||
height: 20px;
|
height: 20px;
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,6 +11,7 @@ import { Hero } from './hero';
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'hero-search',
|
selector: 'hero-search',
|
||||||
templateUrl: 'app/hero-search.component.html',
|
templateUrl: 'app/hero-search.component.html',
|
||||||
|
styleUrls: ['app/hero-search.component.css'],
|
||||||
providers: [HeroSearchService]
|
providers: [HeroSearchService]
|
||||||
})
|
})
|
||||||
export class HeroSearchComponent implements OnInit {
|
export class HeroSearchComponent implements OnInit {
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
/* #docregion */
|
||||||
.selected {
|
.selected {
|
||||||
background-color: #CFD8DC !important;
|
background-color: #CFD8DC !important;
|
||||||
color: white;
|
color: white;
|
||||||
|
@ -57,3 +58,10 @@ button {
|
||||||
button:hover {
|
button:hover {
|
||||||
background-color: #cfd8dc;
|
background-color: #cfd8dc;
|
||||||
}
|
}
|
||||||
|
/* #docregion additions */
|
||||||
|
.error {color:red;}
|
||||||
|
button.delete-button{
|
||||||
|
float:right;
|
||||||
|
background-color: gray !important;
|
||||||
|
color:white;
|
||||||
|
}
|
||||||
|
|
|
@ -6,7 +6,6 @@
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
|
||||||
<link rel="stylesheet" href="styles.css">
|
<link rel="stylesheet" href="styles.css">
|
||||||
<link rel="stylesheet" href="sample.css">
|
|
||||||
|
|
||||||
<!-- Polyfill(s) for older browsers -->
|
<!-- Polyfill(s) for older browsers -->
|
||||||
<script src="node_modules/core-js/client/shim.min.js"></script>
|
<script src="node_modules/core-js/client/shim.min.js"></script>
|
||||||
|
|
|
@ -319,7 +319,9 @@ block add-new-hero-via-detail-comp
|
||||||
The user can *delete* an existing hero by clicking a delete button next to the hero's name.
|
The user can *delete* an existing hero by clicking a delete button next to the hero's name.
|
||||||
Add the following to the heroes component HTML right after the hero name in the repeated `<li>` tag:
|
Add the following to the heroes component HTML right after the hero name in the repeated `<li>` tag:
|
||||||
+makeExcerpt('app/heroes.component.html', 'delete')
|
+makeExcerpt('app/heroes.component.html', 'delete')
|
||||||
|
:marked
|
||||||
|
Add the following to the bottom of the `HeroesComponent` CSS file:
|
||||||
|
+makeExcerpt('app/heroes.component.css', 'additions')
|
||||||
:marked
|
:marked
|
||||||
Now let's fix-up the `HeroesComponent` to support the *add* and *delete* actions used in the template.
|
Now let's fix-up the `HeroesComponent` to support the *add* and *delete* actions used in the template.
|
||||||
Let's start with *add*.
|
Let's start with *add*.
|
||||||
|
@ -415,7 +417,9 @@ block observables-section-intro
|
||||||
The component template is simple — just a text box and a list of matching search results.
|
The component template is simple — just a text box and a list of matching search results.
|
||||||
|
|
||||||
+makeExample('app/hero-search.component.html')
|
+makeExample('app/hero-search.component.html')
|
||||||
|
:marked
|
||||||
|
We'll also want to add styles for the new component.
|
||||||
|
+makeExample('app/hero-search.component.css')
|
||||||
:marked
|
:marked
|
||||||
As the user types in the search box, a *keyup* event binding calls the component's `search` method with the new search box value.
|
As the user types in the search box, a *keyup* event binding calls the component's `search` method with the new search box value.
|
||||||
|
|
||||||
|
@ -559,6 +563,7 @@ block filetree
|
||||||
.file hero-detail.component.html
|
.file hero-detail.component.html
|
||||||
.file hero-detail.component.ts
|
.file hero-detail.component.ts
|
||||||
.file hero-search.component.html (new)
|
.file hero-search.component.html (new)
|
||||||
|
.file hero-search.component.css (new)
|
||||||
.file hero-search.component.ts (new)
|
.file hero-search.component.ts (new)
|
||||||
.file hero-search.service.ts (new)
|
.file hero-search.service.ts (new)
|
||||||
.file rxjs-operators.ts
|
.file rxjs-operators.ts
|
||||||
|
@ -572,7 +577,6 @@ block filetree
|
||||||
.file typings ...
|
.file typings ...
|
||||||
.file index.html
|
.file index.html
|
||||||
.file package.json
|
.file package.json
|
||||||
.file sample.css (new)
|
|
||||||
.file styles.css
|
.file styles.css
|
||||||
.file systemjs.config.json
|
.file systemjs.config.json
|
||||||
.file tsconfig.json
|
.file tsconfig.json
|
||||||
|
@ -597,30 +601,32 @@ block file-summary
|
||||||
`toh-6/ts/app/app.component.ts,
|
`toh-6/ts/app/app.component.ts,
|
||||||
toh-6/ts/app/heroes.component.ts,
|
toh-6/ts/app/heroes.component.ts,
|
||||||
toh-6/ts/app/heroes.component.html,
|
toh-6/ts/app/heroes.component.html,
|
||||||
|
toh-6/ts/app/heroes.component.css,
|
||||||
toh-6/ts/app/hero-detail.component.ts,
|
toh-6/ts/app/hero-detail.component.ts,
|
||||||
toh-6/ts/app/hero-detail.component.html,
|
toh-6/ts/app/hero-detail.component.html,
|
||||||
toh-6/ts/app/hero.service.ts,
|
toh-6/ts/app/hero.service.ts,
|
||||||
toh-6/ts/app/in-memory-data.service.ts,
|
toh-6/ts/app/in-memory-data.service.ts`,
|
||||||
toh-6/ts/sample.css`,
|
|
||||||
null,
|
null,
|
||||||
`app.comp...ts,
|
`app.comp...ts,
|
||||||
heroes.comp...ts,
|
heroes.comp...ts,
|
||||||
heroes.comp...html,
|
heroes.comp...html,
|
||||||
|
heroes.comp...css,
|
||||||
hero-detail.comp...ts,
|
hero-detail.comp...ts,
|
||||||
hero-detail.comp...html,
|
hero-detail.comp...html,
|
||||||
hero.service.ts,
|
hero.service.ts,
|
||||||
in-memory-data.service.ts,
|
in-memory-data.service.ts`
|
||||||
sample.css`
|
|
||||||
)
|
)
|
||||||
|
|
||||||
+makeTabs(
|
+makeTabs(
|
||||||
`toh-6/ts/app/hero-search.service.ts,
|
`toh-6/ts/app/hero-search.service.ts,
|
||||||
toh-6/ts/app/hero-search.component.ts,
|
toh-6/ts/app/hero-search.component.ts,
|
||||||
toh-6/ts/app/hero-search.component.html,
|
toh-6/ts/app/hero-search.component.html,
|
||||||
|
toh-6/ts/app/hero-search.component.css,
|
||||||
toh-6/ts/app/rxjs-operators.ts`,
|
toh-6/ts/app/rxjs-operators.ts`,
|
||||||
null,
|
null,
|
||||||
`hero-search.service.ts,
|
`hero-search.service.ts,
|
||||||
hero-search.component.ts,
|
hero-search.component.ts,
|
||||||
hero-search.service.html,
|
hero-search.service.html,
|
||||||
|
hero-search.component.css,
|
||||||
rxjs-operators.ts`
|
rxjs-operators.ts`
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue