i\'ve created a custom directive in angularjs:
directives.directive(\'myTop\',function($compile) {
return {
restrict: \'E\',
templateUrl: \'views/header.
You'll need to add a link
function to the directive definition for this to work. So basically,
var app = angular.module("myApp", [])
app.directive('myTop',function() {
return {
restrict: 'E',
template: '',
link: function (scope) {
scope.clickFunc = function () {
alert('Hello, world!');
};
}
}
})
And the html:
And here's the fiddle: http://jsfiddle.net/4otpd8ah/