MCPcopy Create free account
hub / github.com/MikeRyanDev/angular-decorators / View

Function View

src/decorators/component/view.js:3–27  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1import {componentWriter} from '../../writers';
2
3export const View = config => t => {
4 if( typeof config !== 'object' || ( !config.templateUrl && !config.template ) || t === undefined )
5 {
6 throw new Error('Config object must be passed to the view decorator with either a view url or an inline template');
7 }
8
9 if(config.templateUrl)
10 {
11 if(componentWriter.has('template', t))
12 {
13 componentWriter.set('template', undefined, t);
14 }
15
16 componentWriter.set('templateUrl', config.templateUrl, t);
17 }
18 else if(config.template)
19 {
20 if(componentWriter.has('templateUrl', t))
21 {
22 componentWriter.set('templateUrl', undefined, t);
23 }
24
25 componentWriter.set('template', config.template, t);
26 }
27}

Callers 4

MyClassClass · 0.90
ParentClass · 0.90
ChildClass · 0.90
GrandChildClass · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected