Rudra
Rudra

Reputation: 1688

When should we use transclude in angular directive?

I am new to angular js, recently I read about scopes and transclude in custom directives. I am looking for some use cases where transclude is used in angular directive.

There might be multiple scenarios, where different combinations of scope(true, false, {}) and transclude(true, false, element) is used.

It's a bit confusing to me, when to use what.

Upvotes: 0

Views: 43

Answers (1)

NenadP
NenadP

Reputation: 647

Angular documentation for directive is your friend

"What does this transclude option do, exactly? transclude makes the contents of a directive with this option have access to the scope outside of the directive rather than inside."

Go through examples there and it might be useful for you to get insight into this.

Upvotes: 1

Related Questions