1

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?

1 Answer 1

1

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

Sign up to request clarification or add additional context in comments.

1 Comment

I have read about ng-show, but I would rather want to know how to create a new directive based on another :-)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.