Quick post that may save someone a lot of time and frustration. Transclusion is a great feature in Angular (see the documentation). The ability to use multiple ng-transclude bits in your template makes it even greater. However, it took me a long time to get the simplest example to work. The problem was that each occurrence of ng-transclude in my template, even though assigned to a specific slot, did end up including everything from the HTML and not just the specified slot.
I compared my work to other examples that did work and found no difference at all in the template, the HTML, nor the code.
Long story short, I noticed in some article on the subject that the multiple transclusion feature was added to Angular starting 1.5. I went to check my bower.json and indeed, I was on angular 1.4.8. Upping the version to 1.5 did solve the problem.
I compared my work to other examples that did work and found no difference at all in the template, the HTML, nor the code.
Long story short, I noticed in some article on the subject that the multiple transclusion feature was added to Angular starting 1.5. I went to check my bower.json and indeed, I was on angular 1.4.8. Upping the version to 1.5 did solve the problem.
No comments:
Post a Comment