How to specify model to a ngInclude directive in AngularJS?

前端 未结 6 1712
北海茫月
北海茫月 2020-11-30 02:48

I would like to use the same HTML template in 3 places, just each time with a different model. I know I can access the variables from the template, but there names will be d

6条回答
  •  北海茫月
    2020-11-30 03:48

    There is a rather simple solution, although I must admit, it's not what Misko would recommend. But if creating a directive is an overkill for you and getting Brice's patch is not feasible then the following will help you.

    It's quite evident why it works. See an example here: http://jsfiddle.net/Cndc6/4/

提交回复
热议问题