Different ng-include's on the same page: how to send different variables to each?

前端 未结 15 1385
北海茫月
北海茫月 2020-12-04 12:17

I\'ve got a page in my AngularJS app in which I would like to include the same html partial, but with different variables. If I do this in my main html:

15条回答
  •  旧时难觅i
    2020-12-04 13:10

    I had the very same problem and I found a way to achieve what I wanted of course it does not look very pretty but still.

    I used the ng-repeat which will create a new scope to include the very same template twice with different values like so (dummy example):

    
    
    
    ...

    Is that acceptable? I guess so.

提交回复
热议问题