(#3) Transclusion in angularjs
Transclusion is one of the those topics which was quite difficult for me to understand at first. It was when I dicided to write this article that I fully understood the concept of transclusion. If we mention transclusion: true in the directive defination then it will make sure that the original content of the directive is available to use and attach to some other portion of the template.
In link function the fifth element is the transclusion (first four being the element, scope, the attributes and the required controllers).
So let me explain to you in code
1 | //defination of directive |
For working example please click here
Transclusion helps in injecting pre-compiled content of a directive to a post-compile directive with or without modifiying the actual content.