jeudi 6 mars 2014

angular: how to handle code provided by attributes


Vote count:

0




As an example of what I want, consider the following example



<select ng-options="option.text for option in options"></select>


In my directive I want to use something similar to ngOptions, because I need to create a list


For example, assume I have a directive barFoo, called as follows:



<bar-foo options="options"></bar-foo>


with a template/html as follows:



<ol>
<li ng-repeat="option in options" ng-bind="option.text"></li>
</ol>


What is needed to change all this into a call like



<bar-foo options="option.text for option in options"></bar-foo>


The main reason I need this is because I don't know the property name holding the label text (in this case it is text)



asked 34 secs ago






Aucun commentaire:

Enregistrer un commentaire