I'm using AngularJS in a project of mine, and I wanted to try creating directives. I already followed several tutorials and I can't see where I'm doing it wrong. Even worst, it doesn't shows up any error or warning message, but it also does not executes the directive's function. Right now, my code is pretty much this:
angular.module('components', []).directive('ngxOnshow', function() {
return {
restrict: 'A',
link: function(scope, element, attrs){
console.log(hello world)
//Resto do código da função
}
};
});
var module = angular.module('app', ['components']);
In the body of the HTML page I have this:
<body ng-autobind ng-app=app>
But then, when I use the directive, it does not work.
<div ng-show=showApp == true ngx-onshow=showAppBar()>
</div>
The rest of the application works just fine, the bindings, the default directives, everything except this. Perhaps I'm missing something?
Thanks,
Scorch :)