Angular directives - element or attribute?

前端 未结 4 547
清酒与你
清酒与你 2020-12-08 15:50

I\'m part of a team with about 6 UI devs, of varying quality and next to no Angular experience. Many are contractors, with little experience with the code base. The app has

4条回答
  •  鱼传尺愫
    2020-12-08 16:24

    I usually defer to the John Papa AngularJS style guide when making these types of decisions. He says:

    Lean towards implementing as an element when its standalone and as an attribute when it enhances its existing DOM element.

提交回复
热议问题