Files
awx/awx/ui/static/js/shared/icon/include-svg.directive.js
Joe Fiorini df8859beb7 Bundle angular templates for app
We were already bundling angular templates for node tests; this commit
reuses the same setup to include them in the app; this means any
new-style template (those under js folder) will be included in angular's
template cache when the app loads, thereby skipping the ajax request for
that template. Huzzah!
2015-07-23 10:35:41 -04:00

14 lines
386 B
JavaScript

export default ['$http', '$rootScope', function($http, $rootScope) {
return {
restrict: 'E',
link: function(scope, element, attrs) {
var path = attrs.href;
$http.get(path).then(function(response) {
element.append(response.data);
$rootScope.$emit('include-svg.svg-ready');
});
}
};
}];