Quantcast
Channel: JavaScriptMVC Forum
Viewing all articles
Browse latest Browse all 3491

Re : Is it a good practise to have one base model and call different finaAll for all?

$
0
0
So if you see here :

Feat =can.Control.extend({ 
var that = this; 
       can.view('images/js/mn/temps/header.ejs', Basemodel.findAll({with overriding parameters}).then(function(d) { 
        return { userdata.userdata : d};
          })).done(function(frag) 
           { 
             that.element.html(frag); 
          
           })
      that.display();
    }});

I though the highlighted part here I am creating the model instance for Feat dynamically and storing in a Feat object. 
But i am wrong I think. 

So I got the point i.e its now a valid way of doing so. 

Also I was not creating instances using the 
  1. InheritedModel = BaseModel.extend({ ... }, {....}) or 
  2. new BaseModel()
I just though calling it from the control would create a new instance for that model. 

Viewing all articles
Browse latest Browse all 3491

Trending Articles