jQuery.fn.model  function     

Returns the first model instance found from jQuery.fn.models or sets the model instance on an element.

//gets an instance
".edit click" : function(el) {
  el.closest('.todo').model().destroy()
},
// sets an instance
list : function(items){
   var el = this.element;
   $.each(item, function(item){
     $('<div/>').model(item)
       .appendTo(el)
   })
}
$.fn.model(type) -> undefined
{optional:Object}

The type of model to return. If a model instance is provided it will add the model to the element.

{undefined}
© Jupiter IT - JavaScriptMVC Training and Support