Skip to content
This repository has been archived by the owner on Feb 22, 2018. It is now read-only.

Commit

Permalink
fix(web_platform): include selector in viewFactoryCache key
Browse files Browse the repository at this point in the history
  • Loading branch information
chirayuk committed Aug 6, 2014
1 parent 997da68 commit aa5abed
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/core_dom/web_platform.dart
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,12 @@ class PlatformViewCache implements ViewCache {
}

async.Future<ViewFactory> fromUrl(String url, DirectiveMap directives) {
ViewFactory viewFactory = viewFactoryCache.get(url);
var key = "[$selector]$url";
ViewFactory viewFactory = viewFactoryCache.get(key);
if (viewFactory == null) {
return http.get(url, cache: templateCache).then((resp) {
var viewFactoryFromHttp = fromHtml(resp.responseText, directives);
viewFactoryCache.put(url, viewFactoryFromHttp);
viewFactoryCache.put(key, viewFactoryFromHttp);
return viewFactoryFromHttp;
});
}
Expand Down

0 comments on commit aa5abed

Please sign in to comment.