Skip to content

Commit

Permalink
feat(views): view imports are now done with <use>
Browse files Browse the repository at this point in the history
This is a BREAKING CHANGE. The import tag is no longer used. We now use
the <use> tag for the same purpose.
  • Loading branch information
EisenbergEffect committed Mar 24, 2015
1 parent c932013 commit 43b0417
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/template-registry-entry.js
Expand Up @@ -26,22 +26,22 @@ export class TemplateRegistryEntry {

setTemplate(template){
var id = this.id,
auImportElements, i, ii, current, src;
useResources, i, ii, current, src;

this.template = template;
auImportElements = template.content.querySelectorAll('au-import');
this.dependencies = new Array(auImportElements.length);
useResources = template.content.querySelectorAll('use');
this.dependencies = new Array(useResources.length);

if(auImportElements.length === 0){
if(useResources.length === 0){
return;
}

for(i = 0, ii = auImportElements.length; i < ii; ++i){
current = auImportElements[i];
for(i = 0, ii = useResources.length; i < ii; ++i){
current = useResources[i];
src = current.getAttribute('from');

if(!src){
throw new Error(`au-import element in ${this.id} has no "from" attribute.`);
throw new Error(`<use> element in ${this.id} has no "from" attribute.`);
}

this.dependencies[i] = new TemplateDependency(
Expand Down

0 comments on commit 43b0417

Please sign in to comment.