UNPKG

1.51 kBTypeScriptView Raw
1import { Injector } from '@angular/core';
2import { Observable } from 'rxjs/Observable';
3import { Frame } from './frame';
4export declare abstract class Controller<M, V> {
5 private _modelSubject;
6 private _viewSubject;
7 private _model$;
8 private _view$;
9 private _model;
10 private _view;
11 private _frame;
12 private _injector;
13 /**
14 * Model observable accessor.
15 */
16 readonly model$: Observable<M>;
17 /**
18 * View observable accessor.
19 */
20 readonly view$: Observable<V>;
21 /**
22 * Model accessor.
23 */
24 readonly model: M;
25 /**
26 * View accessor.
27 */
28 readonly view: V;
29 /**
30 * Frame accessor.
31 */
32 readonly frame: Frame;
33 /**
34 * Model accessor.
35 */
36 readonly injector: Injector;
37 /**
38 * Called after controller is initialized with model, view & frame from framing.
39 */
40 onControllerInit(): void;
41 /**
42 * Called when the controller's route starts resolving.
43 */
44 onResolveStart(): void;
45 /**
46 * Called when the controller's route end resolving.
47 */
48 onResolveEnd(): void;
49 /**
50 * Called when the controller's route resolve is cancelled.
51 */
52 onResolveCancel(): void;
53 /**
54 * Called by framing after construction to link the model, view & frame for this controller.
55 */
56 initController(model: M, view: V, frame: Frame, injector: Injector): void;
57 updateModel(model: M, replace?: boolean): void;
58 updateView(view: V, replace?: boolean): void;
59}