fix(compiler): only sets viewDefinition absUrl if the view has either a template or templateUrl
fixes #1326 closes #1327
This commit is contained in:
parent
b9eab463f7
commit
3d62546314
|
@ -205,7 +205,7 @@ export class Compiler {
|
|||
var templateAbsUrl = null;
|
||||
if (isPresent(view.templateUrl)) {
|
||||
templateAbsUrl = this._urlResolver.resolve(componentUrl, view.templateUrl);
|
||||
} else {
|
||||
} else if (isPresent(view.template)) {
|
||||
// Note: If we have an inline template, we also need to send
|
||||
// the url for the component to the renderer so that it
|
||||
// is able to resolve urls in stylesheets.
|
||||
|
|
|
@ -105,6 +105,14 @@ export function main() {
|
|||
});
|
||||
}));
|
||||
|
||||
it('should not fill absUrl given no inline template or template url', inject([AsyncTestCompleter], (async) => {
|
||||
cmpUrlMapper.setComponentUrl(MainComponent, '/mainComponent');
|
||||
captureTemplate(new View({template: null, templateUrl: null})).then( (renderTpl) => {
|
||||
expect(renderTpl.absUrl).toBe(null)
|
||||
async.done();
|
||||
});
|
||||
}));
|
||||
|
||||
it('should fill absUrl given url template', inject([AsyncTestCompleter], (async) => {
|
||||
cmpUrlMapper.setComponentUrl(MainComponent, '/mainComponent');
|
||||
captureTemplate(new View({templateUrl: '/someTemplate'})).then( (renderTpl) => {
|
||||
|
|
Loading…
Reference in New Issue