In templates in Ember.js, how do you refer to a value in the parent context when you are inside an #each block?

前端 未结 4 775
栀梦
栀梦 2020-12-25 08:58

I have a situation in a template where I want to use an if block on a value in the parent context while inside an each block.

The code:

App = Ember.A         


        
4条回答
  •  忘掉有多难
    2020-12-25 09:27

    No need to place the if inside each in the first place:

    
    

    Demo: http://jsfiddle.net/ppanagi/NQKvy/35/

提交回复
热议问题