mirror of
https://github.com/ZwareBear/awx.git
synced 2026-04-18 14:01:49 -05:00
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!
14 lines
386 B
JavaScript
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');
|
|
});
|
|
}
|
|
};
|
|
}];
|