不要怂,就是干,撸起袖子干!

Commit 259ee5ba by Sascha Depold

method for getting a defined model

1 parent c740ae1a
Showing with 8 additions and 2 deletions
...@@ -15,6 +15,13 @@ ModelManager.prototype.removeModel = function(model) { ...@@ -15,6 +15,13 @@ ModelManager.prototype.removeModel = function(model) {
}) })
} }
ModelManager.prototype.getModel = function(modelName) {
var model = this.models.filter(function(model) {
return model.name == modelName
})
return !!model ? model[0] : null
}
ModelManager.prototype.__defineGetter__('all', function() { ModelManager.prototype.__defineGetter__('all', function() {
return this.models return this.models
}) })
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!