angularjs pass newly created array in attribute to directive

后端 未结 3 1997
余生分开走
余生分开走 2020-12-31 10:17

I\'ve created this fiddle to show my issue...

http://jsfiddle.net/dQDtw/

I\'m passing a newly created array to a directive, and everything is working out jus

3条回答
  •  盖世英雄少女心
    2020-12-31 11:02

    JSON parse doesn't work as effective when the array contains string.

    For example:

    
    

    In the directive you can use scope.$eval to convert what appears in the attribute to an array.

    scope.$eval(attrs.fhServices)
    

提交回复
热议问题