angular-docs-cn/public/docs/_examples/toh-4/ts/app/route.config.pt4.ts

50 lines
1.2 KiB
TypeScript
Raw Normal View History

docs(tutorial): combines all 4 sections + revisions/updates to a.53, hides 3&4 closes #488 ToH History (oldest-to-latest): ---------------------------- created code example/snippets files for use with +makeExample, replace usage of "pre.prettyprint.lang-bash" with this: code-example(format="." language="bash"). fixed spelling errors in examples file path used by +makeExample changed usage of "code-example" to "+makeExample" adding code example/snippets files used in toh 1 fixed example file paths, replaced "pre.prettyprint.lang-bash" with "code-example. " (docs) toh-pt3 initial state created code examples for display in jade, starting conversion of Google doc and trying +makeExample rendering all text copied from doc to jade, still some styling and formatting to perform completed conversion and styling, moved toh3 example files to "tutorial" folder under _examples created specific code example files for chapter toh 3 and re-pathed references in +makeExample minor edit docs) toh combined - initial combined commit updated ToH for a.52 tons of changes, including de-kebab-ing, removed src folder, updated tsconfig too fixing snippets using incorrect ending input tag using inline html and css for the app.component. ToH Part 1 Code: updated the imports, removed obsolete directive delcarations ToH Code Part 1: updated to use imports, interface. will hit others soon toh part 1: ngModel fix toh part1: removed obsolete story that referred to how we used to have to import and declare all directives we used. yay! ToH Part 1: updated to use `boot.ts` and `app.component.ts`. this affected the partials, snippets, and the story. toh part 1: using `npm run go` toh parts 1 -4: modified all places to use `npm run go` toh part 1: refactor for jade toh part 1: fixing the code samples toh part 2: seeping through the story toh part 2: fixing snippets. toh part 2: replaced ngClass with class.selected toh part 2: removed whitespace toh part 2: added final state to the code toh: fixing paths toh part 4: fixing src/app path to app toh part 3: fixing folder path toh part 2: fixed typo toh part 2: typo on ngModel toh part 2: added ngif toh part 2: removed old hero property. moved the details lower, where we need it toh index: updated hero list image to show consistent styling as the other images here QS spelling error (targes -> targets) tweeks: space and ngIF
2015-11-15 21:04:43 -05:00
// #docregion first-route
import {HeroesComponent} from './heroes.component';
export var Routes = {
heroes: {
path: '/,
as: 'Heroes',
component: HeroesComponent
}
};
export const APP_ROUTES = Object.keys(Routes).map(r => Routes[r]);
// #enddocregion first-route
// #docregion dashboard-route
import {HeroesComponent} from './heroes.component';
import {DashboardComponent} from './dashboard.component';
export var Routes = {
dashboard: {
path: '/',
as: 'Dashboard',
component: DashboardComponent
},
heroes: {
path: '/heroes',
as: 'Heroes',
component: HeroesComponent
}
};
export const APP_ROUTES = Object.keys(Routes).map(r => Routes[r]);
// #enddocregion dashboard-route
// #docregion route-parameter-import
import {HeroDetailComponent} from './hero-detail.component';
// #enddocregion route-parameter-import
// #docregion route-parameter-detail
detail: {
path: '/detail/:id',
as: 'Detail',
component: HeroDetailComponent
}
// #docregion route-parameter-detail
// #docregion router-navigate-method
gotoDetail(hero: Hero) {
this._router.navigate([`/${Routes.detail.as}`, { id: hero.id }]);
}
// #docregion router-navigate-method