-
Notifications
You must be signed in to change notification settings - Fork 10
Open
Description
How do I deal with the case where I want to do something asynchronously in my model.init function?
For instance:
myModel.init = function(instance){
exec('ls -l',function(err,stdout,stderr){
//error checking etc
instance.files(stdout);
}
}So far my solution has been to use a promise as the contents of that particular attribute, but that doesn't seem ideal. Is there a better way?
In my controller, it would be nice if I could do this:
Q.when(myModel.create()).then(.... //etcMetadata
Metadata
Assignees
Labels
No labels