Reputation: 12285
I am pretty new to AngularJS and creating directives.
Lets say I wanted a "delayed ng-show", that means it should work like ng-show
, but the element should be visible after 2 seconds as opposed to immediately the expression was fulfilled. I don't want to change the current behavior of ng-show
, just to create a new ng-delayed-show
directive.
Can anyone give me an example or link me to direct documentation on how to reuse or create a sub directive of another directive?
Upvotes: 1
Views: 92
Reputation: 42669
You do not need to create directive for this. You can very well do it using animation capabilities of AngularJS which internally uses CSS capability called easing.
Read documentation for ngshow and it's animation section here http://docs.angularjs.org/api/ng.directive:ngShow
Since i am not very familiar with it, this post can help you http://www.yearofmoo.com/2013/04/animation-in-angularjs.html#how-to-use-animations-in-angularjs
Upvotes: 1