Ember.js-插座的默认内容
对不起,我的英语不够好,无法描述更复杂的事情,但我会尽我所能 我快疯了。我只想在Ember.js中为一个outlet定义一个默认内容,但我找不到任何解决方案。我发现的示例使用url匹配,但在我的示例中,没有特殊的url来识别默认模板 让我们看看:Ember.js-插座的默认内容,ember.js,Ember.js,对不起,我的英语不够好,无法描述更复杂的事情,但我会尽我所能 我快疯了。我只想在Ember.js中为一个outlet定义一个默认内容,但我找不到任何解决方案。我发现的示例使用url匹配,但在我的示例中,没有特殊的url来识别默认模板 让我们看看: application <-- the application frame, contains an outlet / <-- the index, contains also an outlet /foob
application <-- the application frame, contains an outlet
/ <-- the index, contains also an outlet
/foobar <-- some other stuff, which will be rendered in the outlet of index, if the URL is set => that works!
application我想我了解你在找什么
在模板中,创建ID设置为“index”的脚本。该脚本中的任何内容都应该在加载“默认”URL时显示
<script type="text/x-handlebars" id="index">
Welcome to my Ember.js site!
</script>
欢迎来到我的Ember.js网站!
并确保您的脚本ID中带有“应用程序”,您有一个插座集
<script type="text/x-handlebars" id="application">
<div>
Testing 1..2..3...
</div>
<div>
{{outlet}}
</div>
</script>
测试1..2..3。。。
{{outlet}}
希望这能有所帮助。默认值的确切含义是什么?“/”通常指应用程序+索引模板。您是否有bin示例来说明您的问题?