@@ -4,11 +4,11 @@
|
||||
import {Component, OnInit} from 'angular2/core';
|
||||
import {Crisis, CrisisService} from './crisis.service';
|
||||
import {RouteParams, Router} from 'angular2/router';
|
||||
// #docregion ngCanDeactivate
|
||||
// #docregion routerCanDeactivate
|
||||
import {CanDeactivate, ComponentInstruction} from 'angular2/router';
|
||||
import {DialogService} from '../dialog.service';
|
||||
|
||||
// #enddocregion ngCanDeactivate
|
||||
// #enddocregion routerCanDeactivate
|
||||
|
||||
@Component({
|
||||
// #docregion template
|
||||
@@ -28,13 +28,13 @@ import {DialogService} from '../dialog.service';
|
||||
// #enddocregion template
|
||||
styles: ['input {width: 20em}']
|
||||
})
|
||||
// #docregion ngCanDeactivate, cancel-save
|
||||
// #docregion routerCanDeactivate, cancel-save
|
||||
export class CrisisDetailComponent implements OnInit, CanDeactivate {
|
||||
|
||||
public crisis: Crisis;
|
||||
public editName: string;
|
||||
|
||||
// #enddocregion ngCanDeactivate, cancel-save
|
||||
// #enddocregion routerCanDeactivate, cancel-save
|
||||
constructor(
|
||||
private _service: CrisisService,
|
||||
private _router: Router,
|
||||
@@ -87,7 +87,7 @@ export class CrisisDetailComponent implements OnInit, CanDeactivate {
|
||||
this._router.navigate(route);
|
||||
}
|
||||
// #enddocregion gotoCrises
|
||||
// #docregion ngCanDeactivate, cancel-save
|
||||
// #docregion routerCanDeactivate, cancel-save
|
||||
}
|
||||
// #enddocregion ngCanDeactivate, cancel-save
|
||||
// #enddocregion routerCanDeactivate, cancel-save
|
||||
// #enddocregion
|
||||
|
||||
@@ -403,7 +403,7 @@ figure
|
||||
Here's an example of a service class that logs to the browser console
|
||||
+makeExample('architecture/ts/app/logger.service.ts', 'class', 'app/logger.service.ts (class only)')(format=".")
|
||||
:marked
|
||||
Here's a `HeroServce` that fetches heroes and returns them in a resolved [promise](http://www.html5rocks.com/en/tutorials/es6/promises/).
|
||||
Here's a `HeroService` that fetches heroes and returns them in a resolved [promise](http://www.html5rocks.com/en/tutorials/es6/promises/).
|
||||
The `HeroService` depends on the `LoggerService` and another `BackendService` that handles the server communication grunt work.
|
||||
+makeExample('architecture/ts/app/hero.service.ts', 'class', 'app/hero.service.ts (class only)')(format=".")
|
||||
:marked
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user