UNPKG

1.87 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 _model$;
7 private _model;
8 private _viewSubject;
9 private _view$;
10 private _view;
11 private _markForCheckSubject;
12 private _markForCheck$;
13 private _frame;
14 private _framerName;
15 private _injector;
16 private _refCount;
17 /**
18 * Model observable accessor.
19 */
20 readonly model$: Observable<M>;
21 /**
22 * Model accessor.
23 */
24 readonly model: M;
25 /**
26 * View observable accessor.
27 */
28 readonly view$: Observable<V>;
29 /**
30 * View accessor.
31 */
32 readonly view: V;
33 /**
34 * Mark for check observable accessor.
35 */
36 readonly markForCheck$: Observable<boolean>;
37 /**
38 * Frame accessor.
39 */
40 readonly frame: Frame;
41 /**
42 * Model accessor.
43 */
44 readonly injector: Injector;
45 /**
46 * Called after controller is initialized with model, view & frame from framing.
47 */
48 onControllerInit(): void;
49 /**
50 * Called when the controller's route starts resolving.
51 */
52 onResolveStart(): void;
53 /**
54 * Called when the controller's route end resolving.
55 */
56 onResolveEnd(): void;
57 /**
58 * Called when the controller's route resolve is cancelled.
59 */
60 onResolveCancel(): void;
61 /**
62 * Called by framing after construction to link the model, view & frame for this controller.
63 */
64 initController(model: M, view: V, frame: Frame, framerName: string, injector: Injector): void;
65 updateModel(model: M, replace?: boolean): void;
66 updateView(view: V, replace?: boolean): void;
67 markForCheck(): void;
68 attach(): void;
69 detach(): void;
70 onAttached(): void;
71 onDetached(): void;
72}