小编Lun*_*kzx的帖子

CouchDB 返回“不评估为函数”

我得到了这个代码

 {
    "_id": "_design/test",
    "_rev": "10-651aa6314effdad0bca00fc4a3da38f6",
    "views": {
       "foo": {
           "map": "(function(doc){ emit(doc._id, doc._rev)})"
       },
       "bar": {
           "map": "(function(doc){if(doc.date && doc.title) {emit(doc.date, doc.title);})"
       }
      }
    }
Run Code Online (Sandbox Code Playgroud)

为什么它返回:

表达式不求值为函数。((new String("(function(doc){if(doc.date && doc.title) {emit(doc.date, doc.title);})")))

couchdb

5
推荐指数
1
解决办法
3360
查看次数

使用didInsertElement时与emberjs和jquery不一致

我目前正在使用emberjs来构建一个应用程序,我接近完成但我有一些与应用程序中的视图相关的didInsertElement方法相关的不一致.这是代码:

     didInsertElement : function(){           
        Ember.run.next(this,function(){
            var sub = this.$(document).find('.sub_t');
            $(sub).not('button').siblings('.inside').toggle();
            $(sub).each(function(i){
                $(this).attr('id','s_t' + i + '');
                var s_t = $(this).nextUntil(".sub_t");
                $(s_t).not('button').wrapAll("<div class='s_t" + i + "'></div>");
            });
         });
    },
Run Code Online (Sandbox Code Playgroud)

问题是,即使我没有使用Ember.run.next,应用程序视图反应也不一致.我只是想在我的视图中修改内容.有时jquery工作有时它不是,并且不清楚如何重现这个bug.

它是否与加载文件的大小有关?或者是滥用Ember运行循环还是插入元素方法?

有人提到了吗?或暗示正在发生的事情以及我可能会做些什么来解决这个问题?

javascript jquery ember.js

0
推荐指数
1
解决办法
1030
查看次数

标签 统计

couchdb ×1

ember.js ×1

javascript ×1

jquery ×1