Where does Angular store directive templates?
I have a module / directive, and I want to get the template that it uses in another directive. In particular, I want to view raw HTML and variable names with scope
Some directives
var someModule = angular.module ('someModule', []);
someModule.controller ('someModuleCtrl', ['$ scope',
function ($ scope) {
'use strict';
// Do stuff
};
}]);
someModule.directive ('someModule', [
function () {
'use strict';
return {
restrict: 'AE',
template: 'some HTML and {{AngularVar}}',
scope: {
input1: '=',
input2: '=',
optional1: '=?'
},
controller: "someModuleCtrl"
};
}]);
Some other directive in which I want to see the raw HTML of another tempalte directive
var myModule = angular.module ('MyModule', []);
myModule.controller ('MyModuleCtrl', ['$ scope',
function ($ scope) {
console.log (-------- someModule.directives ['someModule']. template ---------);
}]);
source
share