feat(core): provide support for relative assets for components
Assets defined for `templateUrl` and `styleUrls` can now be loaded in relative to where the component file is placed so long as the `moduleId` is set within the component annotation. Closes #5634
This commit is contained in:
19
modules/playground/src/relative_assets/index.ts
Normal file
19
modules/playground/src/relative_assets/index.ts
Normal file
@ -0,0 +1,19 @@
|
||||
import {bootstrap} from 'angular2/bootstrap';
|
||||
import {reflector} from 'angular2/src/core/reflection/reflection';
|
||||
import {ReflectionCapabilities} from 'angular2/src/core/reflection/reflection_capabilities';
|
||||
|
||||
import {Renderer, ElementRef, Component, Directive, Injectable} from 'angular2/core';
|
||||
import {MyCmp} from './my_cmp/my_cmp';
|
||||
|
||||
export function main() {
|
||||
reflector.reflectionCapabilities = new ReflectionCapabilities();
|
||||
bootstrap(RelativeApp);
|
||||
}
|
||||
|
||||
@Component({
|
||||
selector: 'relative-app',
|
||||
directives: [MyCmp],
|
||||
template: `component = <my-cmp></my-cmp>`,
|
||||
})
|
||||
export class RelativeApp {
|
||||
}
|
Reference in New Issue
Block a user