我很困惑如何使用新的路由器方法连接插座.
index.html的:
...
<script type="text/x-handlebars" data-template-name="application">
<h4>The application handelbar</h4>
{{! outlet 1}}
{{outlet}}
</script>
<script type="text/x-handlebars" data-template-name="index">
<h4>The index handelbar</h4>
{{! outlet 2 and 3}}
{{outlet nav}}
{{outlet main}}
</script>
<script type="text/x-handlebars" data-template-name="main">
<h4>The main handelbar</h4>
</script>
<script type="text/x-handlebars" data-template-name="nav">
<h4>The nav handelbar</h4>
</script>
...
Run Code Online (Sandbox Code Playgroud)
app.js:
...
App.Router.map(function(match) {
this.resource("index", { path: "/" });
this.route("test");
});
App.IndexController = Ember.Controller.extend({
});
App.IndexView = Ember.View.extend({
templateName: 'index'
});
...
Run Code Online (Sandbox Code Playgroud)
此代码呈现outlet-1.
问题:
谢谢
你
使用package.json中的peerDependencies,我可以确保用户在应用程序根文件夹中有一个特定的模块:
module_a
var modB = require('module_b')
...
Run Code Online (Sandbox Code Playgroud)
module_a的package.json
...
"peerDependencies": {
"module_b": "^1.0.1"
},
"dependencies": {
},
...
Run Code Online (Sandbox Code Playgroud)
my_app应用
var modA = require('module_a')
var modB = require('module_b')
...
Run Code Online (Sandbox Code Playgroud)
文件结构
使用npm v1/v2,这个配置非常完美:在rootfolder中npm install module_a安装module_a和module_b:
my_app
node_modules
module_a
module_b
Run Code Online (Sandbox Code Playgroud)
太好了,这就是我想要的!
npm v3
但在安装时npm install module_a,npm v2会打印此警告:
npm WARN peerDependencies The peer dependency module_b@^1.0.1 included
from module_a will no longer be automatically installed to fulfill the
peerDependency in npm 3+. Your application will …Run Code Online (Sandbox Code Playgroud) 我正在使用Multiselect视图:
{{view Ember.Select
multiple="true"
contentBinding="App.filtersProductController"
selectionBinding="App.filtersController.products"
optionLabelPath="content.fullName"
optionValuePath="content.id"
isVisibleBinding="App.filtersController.productListBox"}}
Run Code Online (Sandbox Code Playgroud)
是否可以在"选择"框中预选多个值并以编程方式更改所选值?背景:我想将三个"选择"框设置的不同组合保存为书签.加载书签时,我必须设置"选择"框值.
谢谢