任何人都可以提供一个关于如何将Meteor应用程序连接到WebStorm调试器的简短步骤吗?
是否有可能使一个html5固定Flexbox的布局header/footer和一个滚动的article部分像下面的Firefox 24和铬 31?
+----------+
| header |
+----------+
| article ||
| ||
| ||
| ||
+----------+
| footer |
+----------+
Run Code Online (Sandbox Code Playgroud)
我试过这个(简化):
body {
display: flex;
flex-direction: column;
}
header {
flex: 1;
}
article {
flex: 8;
overflow-y: scroll;
}
footer {
flex: 1;
}
Run Code Online (Sandbox Code Playgroud)
现在我正试图填充剩余空间article,但如果内容高度小于窗口高度,则页脚不固定,如果它更大,则页脚滚出可视区域...
我昨天更新了我的流星并尝试使用新的Meteor.Collection.ObjectID.但由于没有成功.首先,我以这种方式更新了我的收藏:
myCollection = new Meteor.Collection('mycollection', {idGeneration: 'MONGO'}
现在,新的正常插入有_id样Wi2RmR6CSapkmmdfn......(?)
然后我有一个包含数组的集合.我喜欢为这个数组中的每个对象都有一个唯一的id.所以我$push是一个像id: new Meteor.Collection.ObjectID()我的数组一样的字段的对象.数据库中的结果如下:ObjectId("5b5fc278305d406cc6c33756").(这似乎很正常.)
但后来我想更新我推送的对象,如果id等于一个id,我之前将其作为数据属性存储在html标签中.
var equals = EJSON.equals(dbId, htmlId);(这导致每一次false,所以我记录的值dbId,并htmlId与控制台console.log(typeof dbId, dbId);)
这两个变量的值如下:
object { _str: 'a86ce44f9a46b99bca1be7a9' } (DBID)
string ObjectID("a86ce44f9a46b99bca1be7a9") (htmlId;这似乎是正确的,但为什么自定义类型是一个字符串?)
如何使用Meteor.Collection.ObjectID正确?
我刚刚开始尝试使用聚合物,并尝试将其与AngularJS一起用于一个单页应用程序中.因此我拿了两个polymer-ui-components:polymer-ui-sidebar-menu和polymer-ui-pages.每次用户从侧边栏中选择一个项目时,页面组件应该显示其项目具有相同的索引...
但是如何连接这两个组件?
我试图onclick从菜单中使用该事件,但这不能按预期工作.
也许除了自己的文档之外,万维网上还有关于聚合物的有用文件吗?
更新:
HTML:
<polymer-ui-sidebar-menu label=Channels>
<polymer-ui-menu-item ng-repeat="channel in channels"
ng-click=select($index)
label="{{ channel }}"
icon=menu>
</polymer-ui-menu-item>
</polymer-ui-sidebar-menu>
<polymer-ui-pages>
<span ng-repeat="channel in channels">content: {{ channel }}</span>
</polymer-ui-pages>
Run Code Online (Sandbox Code Playgroud)
控制器:
$scope.select = function (index) {
angular.element("polymer-ui-sidebar-menu")[0].selected = idx;
angular.element("polymer-ui-pages")[0].selected = idx;
};
Run Code Online (Sandbox Code Playgroud)
要使选择器angular.element(selector)工作,您必须包括jquery之前angular和polymer之前jquery!