Skip to content

Commit

Permalink
fix(view-engine): use .address in case of RegistryEntry
Browse files Browse the repository at this point in the history
  • Loading branch information
StrahilKazlachev committed Aug 12, 2017
1 parent a93206a commit ab1064c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/view-engine.js
Expand Up @@ -102,9 +102,10 @@ export class ViewEngine {
loadContext = loadContext || new ResourceLoadContext();

return ensureRegistryEntry(this.loader, urlOrRegistryEntry).then(registryEntry => {
const url = typeof urlOrRegistryEntry === 'string' ? urlOrRegistryEntry : urlOrRegistryEntry.address;
if (registryEntry.onReady) {
if (!loadContext.hasDependency(urlOrRegistryEntry)) {
loadContext.addDependency(urlOrRegistryEntry);
if (!loadContext.hasDependency(url)) {
loadContext.addDependency(url);
return registryEntry.onReady;
}

Expand All @@ -116,7 +117,7 @@ export class ViewEngine {
return Promise.resolve(new ProxyViewFactory(registryEntry.onReady));
}

loadContext.addDependency(urlOrRegistryEntry);
loadContext.addDependency(url);

registryEntry.onReady = this.loadTemplateResources(registryEntry, compileInstruction, loadContext, target).then(resources => {
registryEntry.resources = resources;
Expand Down

0 comments on commit ab1064c

Please sign in to comment.