As I\'m new to Angular JS I was wondering how could I load an external template and compile it with some data into the targeted div
.
For instance I have thi
Let's say I have this index.html:
And I have a template file "tpl/ng.menu.tpl" with only these 4 lines:
My directives mapping "js/directives.js":
angular.module('myApp',['myApp.directives']);
var myModule = angular.module('myApp.directives', []);
myModule.directive('mainmenu', function() {
return {
restrict:'E',
replace:true,
templateUrl:'tpl/ng.menu.tpl'
}
});