- I have nav-bar containing links
link 1
,link 2
. - On selection of each link I want to inject partial page in the content section.
- I want to achieve this using
Custom-directive
in AngularJS.
I searched and got this piece of code snippet.
But again, i don't know to inject partial pages.
var app = angular.module('app', []);
app.directive('clicker', function(){
var link = function(scope){
scope.showMessage = function(){
alert('you clicked the directive!');
};
};
return {
link: link
template: "<button ng-click='showMessage()'>Click me!</button>"
};
});