MCPcopy
hub / github.com/angular-ui/ui-router / load

Method load

src/statebuilders/views.ts:117–133  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

115 constructor(public path: PathNode[], public viewDecl: Ng1ViewDeclaration, public factory: TemplateFactory) {}
116
117 load() {
118 const $q = services.$q;
119 const context = new ResolveContext(this.path);
120 const params = this.path.reduce((acc, node) => extend(acc, node.paramValues), {});
121
122 const promises: any = {
123 template: $q.when(this.factory.fromConfig(this.viewDecl, params, context)),
124 controller: $q.when(this.getController(context)),
125 };
126
127 return $q.all(promises).then((results) => {
128 trace.traceViewServiceEvent('Loaded', this);
129 this.controller = results.controller;
130 extend(this, results.template); // Either { template: "tpl" } or { component: "cmpName" }
131 return this;
132 });
133 }
134
135 getTemplate = (uiView, context: ResolveContext) =>
136 this.component

Callers 1

viewSpec.tsFile · 0.80

Calls 4

getControllerMethod · 0.95
whenMethod · 0.80
fromConfigMethod · 0.80
extendFunction · 0.50

Tested by

no test coverage detected