cayasso/oomvc — Issue #14: Can I use class and instance vars for new records and the like?
Author: noctivityinc
Created: 2011-10-27 03:29:12+00:00
State: open

In one of your samples I noticed this syntax, which I think is still correct or usable:

var g = new Goal({});
g.title = 'This is my goal title';
g.notes = 'This is my goal note';
g.save();

var task = new goal.task.newRecord('task_a');

What I'm wondering, for consistency sake, is if I can do this:

var Goal = new Goal();
var g = Goal.newRecord();
g.title = 'This is my goal title';
g.notes = 'This is my goal note';
g.save();

To me that makes more sense since I'm creating a class level variable "Goal" and the. A new instance of that class called "goal.". It don't matter to me if the first version also works, but I wanted to check if this syntax would work as well.

Thx