0
exports.definition = {

    config : {
        // table schema and adapter information
    },

    extendModel: function(Model) {      
        _.extend(Model.prototype, {
            // Extend, override or implement the Backbone.Model methods                     
        });
        return Model;
    },

    extendCollection: function(Collection) {        
        _.extend(Collection.prototype, {

        }); // end extend

        return Collection;
    }
}

やろうとするとvar model = Alloy.createCollection('model');

alert(appointments.fetch());

結果が出ません。

4

1 に答える 1

0

fetch非同期です。そのため、promise を返すか、コールバックを設定する必要があります。

appointments.fetch().done(function( r ) { console.log(r) });

また、決してalertデバッグには使用しないでください。これは無駄です。常にコンソールを開いて使用するconsole.log

于 2013-02-22T15:39:27.357 に答える