Is there an easier way to persist an object to db when using angular-meteor? -
i meteor-angular, however, in following code snippet, think there still friction when persisting changes db. example, in code sample:
saveparty(name: string, description: string) { parties.update(this.selectedparty._id, {$set: {name: name, description: description}}); }
it going difficult manually type "name: name, description: description" if there large number of fields.
is possible (kind of breezsjs does):
saveparty() { parties.save(this.selectedparty); }
or better yet:
saveparty() { this.selectedparty.save(); }
yes :) take @ angularmeteorcollection methods here - http://angular-meteor.com/api/angularmeteorcollection#methods
angularmeteorobject methods here - http://angular-meteor.com/api/angularmeteorobject and
and examples @ bottom
Comments
Post a Comment