我不能在运行在上的Ember应用程序中使用live。我收到以下错误消息:
[Report Only] Refused to load the script
'http://ember-js-126346.nitrousapp.com:49152/livereload.js?snipver=1'
because it violates the following Content Security Policy directive:
"script-src 'self' 'unsafe-eval' localhost:49152 0.0
我可能遗漏了一些东西,但似乎Meteor的“魔力”围绕着将数据绑定到DOM元素,以及通过工具栏更新文本和HTML片段:。
然而,当尝试编写一个流星应用程序在元素中显示实时数据时,这是很棒的,但当实时数据发生变化时,我无法找到更新画布的“流星方式”,因为画布是通过JS代码填充的,如下所示:
var g = canvas.getContext('2d')
g.fillRect(x, y, w, h)
而不是HTML模板中的数据背景文本。
我试图使用来自Meteor.Collection的数据在画布上进行绘制。
我唯一的想法是将画布绘制的JS代码嵌入到由车把vars填充的脚本标记中的
我正在使用meteor- D3 -force.js示例:使用Meteor JS的实时反应式D3力布局图。
我在meteor应用程序中有一个d3代码。我想向d3定义的元素添加一个事件处理程序,例如:
d3.select(#element).on("click",remove()).
然后,我想在“流星”中实现一些东西。
// When the element changes, delete
// the element.
Template.chat.events({
'change #element': function () {
Messages.remove