Skip to content

Commit

Permalink
feat(templates): exports templateUrl
Browse files Browse the repository at this point in the history
Closes Urigo#1313
  • Loading branch information
Kamil Kisiela committed May 10, 2016
1 parent e657e8d commit d687049
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions packages/angular-templates-runtime/ng-template-compiler.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,16 @@ var minifyHtml = function(html) {
});
};

function wrapAngularTemplate(id, contents) {
return "angular.module('angular-templates').run(['$templateCache', function($templateCache) { $templateCache.put('" +
id + "'," + JSON.stringify(contents) + ");}]);";
function wrapAngularTemplate(templateUrl, contents) {
return `
angular.module('angular-templates')
.run(['$templateCache', function($templateCache) {
$templateCache.put('${templateUrl}', ${JSON.stringify(contents)});
}]);
if (typeof module !== 'undefined' && module.exports) {
module.exports = "${templateUrl}";
}
`;
}

StaticHtmlTagHandler.init = function(tags) {
Expand Down

0 comments on commit d687049

Please sign in to comment.