We have an project running angular 1.0.8. I need to use ngTransclude to pass a dynamic 'html' to a directive and render it. Except it does not look like 1.0.8 supports ngTransclude. Is there any other workaround to pass markup to a directive and render it? Upgrading is not an option (unfortunately).
Asked
Active
Viewed 47 times
0
-
`transclude` is not about passing "dynamic" html... and `ng-transclude` was available in 1.0.8: https://github.com/angular/angular.js/blob/v1.0.8/src/ng/directive/ngTransclude.js – New Dev Mar 31 '15 at 06:59
-
The way I understand it, ng-transclude lets you pass in a string of html and render it on the dom? How is that not dynamic html? Also if its not supported in v1 why does it not show up in the angular documentation: https://docs.angularjs.org/api/ng/directive/ngTransclude (change the version). – MarzSocks Mar 31 '15 at 07:18
-
You understand it incorrectly. `ng-transclude` is a placeholder you use in a directive's template to "transclude" the child contents of the element hosting the directive. What you are looking is probably `ng-bind-html` – New Dev Mar 31 '15 at 07:20
-
Here's the documentation for 1.0.7: https://code.angularjs.org/1.0.7/docs/api/ng.directive:ngTransclude – New Dev Mar 31 '15 at 07:22
-
I appreciate the replies & I (or someone) must be confused, because in this example: "
Stuff inside the custom directive " is passed through to a directive and rendered in the template. I want to do this. But it simply isn't working - I've put it down to the version number ( ? ). http://stackoverflow.com/questions/24725399/what-is-ng-transclude – MarzSocks Mar 31 '15 at 07:30 -
Well.. show a plunker with code that doesn't work. This seems to work fine for me: http://plnkr.co/edit/iiMmwhjaxDFamcyuHWCd?p=preview – New Dev Mar 31 '15 at 07:43
-
OK, putting something together.. – MarzSocks Mar 31 '15 at 07:48