Ember's registerBoundHelper and handlebar blocks

ぐ巨炮叔叔 提交于 2019-12-01 22:46:08

You shouldn't ignore it because it isn't supported, if MyProperty were to change after the render has occurred it will break.

Conditional helpers aren't supported (to many of our demise) in ember handlebars. The reason being is the core team wants this logic as a computed property instead of logic in the template.

IE

Controller

App.IndexController = Em.ObjectController.extend({
  isPropertyOne: Em.computed.equal('myProperty', '1')
});

Template

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