[Representation] Provide initial templates

...to avoid temporarily replacing with a comment when this
is not needed.
This commit is contained in:
Victor Woeltjen
2015-10-29 08:17:25 -07:00
parent 5fba6f5ead
commit 54d608adb2
2 changed files with 12 additions and 4 deletions

View File

@ -58,10 +58,14 @@ define(
var templateMap = {};
function link(scope, element) {
var changeTemplate = templateLinker.link(scope, element);
var changeTemplate = templateLinker.link(
scope,
element,
scope.key && templateMap[scope.key]
);
scope.$watch('key', function (key) {
changeTemplate(templateMap[key]);
changeTemplate(key && templateMap[key]);
});
}