I'm pretty new to AngularJS and have made my first directive. Is this a good or a bad way to do this? It works, but can't figure out if this is clever or not.
.directive('showWithDelay', function($timeout){
return {
restrict: 'A',
link: function($scope, $element, attrs){
$element.addClass("ng-hide");
$timeout(function() {
$element.removeClass("ng-hide");
},attrs.showWithDelay);
}
}
})
Usage in template
<a class="button button-block rounded" show-with-delay="6000">CLICK ME</a>
button will be displayed after 6 sec.