Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ember.js/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ember.js Meteor中的Spacebars是否有类似于{{bind attr}}或{{link to}}的软件包?_Ember.js_Meteor_Spacebars - Fatal编程技术网

Ember.js Meteor中的Spacebars是否有类似于{{bind attr}}或{{link to}}的软件包?

Ember.js Meteor中的Spacebars是否有类似于{{bind attr}}或{{link to}}的软件包?,ember.js,meteor,spacebars,Ember.js,Meteor,Spacebars,我知道空格键的基本功能,但似乎找不到任何类似于{{bind attr class=“”}}或{{link to}}的东西,比如在Ember的把手上 我所能找到的最好方法是手动创建这些,但我想首先检查meteor中是否有更直接的方法。如果您使用的是iron router,有很多帮助程序,包括。Meteor的空格键确实通过稍微不同的方法提供了类似的功能 类似于bind attr meteor的 可以在HTML开始标记中使用双括号标记来指定 任意属性集: <div {{attrs}}>..

我知道空格键的基本功能,但似乎找不到任何类似于
{{bind attr class=“”}}
{{link to}}
的东西,比如在Ember的把手上


我所能找到的最好方法是手动创建这些,但我想首先检查meteor中是否有更直接的方法。

如果您使用的是iron router,有很多帮助程序,包括。

Meteor的空格键确实通过稍微不同的方法提供了类似的功能

类似于bind attr meteor的

可以在HTML开始标记中使用双括号标记来指定 任意属性集:

<div {{attrs}}>...</div>
。。。
标记必须计算为对象 它用作属性名称和值字符串的字典

或者,也可以组合使用属性中的双括号标记来提供动态内容,如中所示:

<input type="checkbox" class="checky {{moreClasses}}" checked={{isChecked}}>

关于到的链接,meteor并没有直接提供解决方案,但由于它在路由上下文中,您应该检查路由器的功能。Meteor的“事实路由器”是第三方软件包,名为,它实际上为其路由器提供了完全相同的解决方案

{{{#linkTo route=“post.show”data=getData query=“q=s”hash=“hashFrag”class=“my cls”}
后期演出
{{/linkTo}
上面的表达式将转换为如下所示的html:

<a href="/posts/1?q=s#hashFrag" class="my-cls">
  <span style="color: orange;">
    Post Show
  </span>
</a>

<a href="/posts/1?q=s#hashFrag" class="my-cls">
  <span style="color: orange;">
    Post Show
  </span>
</a>