I made a custom directive:
js part:
angular.module("myDirectives", []).directive("ngShowbox", function(){
return {
restrict: "E",
scope: {
title: "="
},
template: "<a href='#' ng-click='show($event)'>{{title}}</a>",
controller: function($scope, $element){
$scope.show = function(event){
// do something...
}
}
}
});
html part:
<ng-showbox title="whatToPutHere??"></ng-showbox>
I would like to pass some text from the title attribute, then my template will show the text. How can I make it?
Thank you very much :)