Models - dingojs/dingo.js GitHub Wiki
function model(id,args){
var elemref=addelem(id,'type',args);
elemref.addchild('child','type',args);
return elemref;
}
var test=addelem('test',model,{color:'blue'});
id(string)- the id of the element
args(arr)- an associative array of properties and their values to add to an element type or a class.
A model is a template for elements. Each model type has a constructor that is called by the framework. This constructor takes in the id and args, and then batch creates all the necessary elements. If you need to create en element more than once, this can reduce the copy/paste and improve extendability.