angularjs - Angular Selective Transclude -
Does anyone know a way to give instructions that can separate the body of the selected instructions?
For example, if I have the following div and instructions for my wiper.
& lt; Div data-my-rapper = "foo" & gt; & Lt; H1 & gt; Hello World & lt; / H1> & Lt; / Div & gt; I have to have code in my direction which is like this pseudo code.
if (foo.locked) {// user is saying a constant template that the item is locked} and {// to include the body contents} < P> Is there a way to direct that the content should be separated? Or if there is equal to / if / else, is there any recommended way to allow the content to swap instead of that element's body? Sits in the directorate?
You use the Fifth Logic to function Add Also remember to set the directive transclude property. Note: / P> Note: >
Please keep in mind that if you have a version of AngularJS before 1.2.x If you are using it, the linking function is available as a directive of the compile property as the third argument. Since then it has been removed.
Comments
Post a Comment