fix(compiler): clone templates before compiling them
This is needed as the compiler changes templates during compilation and we are caching templates in the `TemplateLoader`. Closes #1058
This commit is contained in:
@ -39,7 +39,9 @@ export class TemplateLoader {
|
||||
StringMapWrapper.set(this._htmlCache, url, promise);
|
||||
}
|
||||
|
||||
return promise;
|
||||
// We need to clone the result as others might change it
|
||||
// (e.g. the compiler).
|
||||
return promise.then( (tplElement) => DOM.clone(tplElement) );
|
||||
}
|
||||
|
||||
throw new BaseException('View should have either the url or template property set');
|
||||
|
Reference in New Issue
Block a user