What is the equivalent annotation for the old map/@attr in AngularDart?

懵懂的女人 提交于 2019-12-18 04:26:05

问题


The AngularDart tutorial (at of the time of this writing), recommends binding component fields to attributes like this:

map: const {
  'max-rating' : '@maxRating',
  'rating' : '<=>rating'
}

However, I see also that Angular has @NgOneWay, @NgTwoWay, and others. I can't find the annotation for @. Which annotation do I want if I want the same semantics as @maxRating ?

Apparently:

@NgOneWay == =>

@NgTwoWay == <=>

@NgOneWayOneTime == =>!

??? == @


回答1:


I think @NgAttr is what you are looking for.

For callbacks there is also @NgCallback == & - just to complete your list.



来源:https://stackoverflow.com/questions/21422743/what-is-the-equivalent-annotation-for-the-old-map-attr-in-angulardart

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!