Is it possible to apply multiple AngularJS controllers on the same element

后端 未结 6 1641
悲哀的现实
悲哀的现实 2021-01-31 08:58

Is it possible to apply multiple AngularJS controllers on the same element ?

6条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-31 09:37

    No

    HTML is a form of XML, and it is not valid xml to have multiple non-unique attributes on the same element. In other words,

    is invalid. But what about when we do

    This is valid xml/HTML, but it is not assigning two controllers to the div with id c. This is called Nested Controllers.

提交回复
热议问题