Custom Attributes

You can write custom attribute handlers to add your own custom template rendering behaviour.


jmvc.template.attributes.add({
  name: 'my-attribute', //the name of the attribute as used in the template
  remove: true, //if true, the attribute will be removed from the rendered html
  stop: false, //if true, it prevents the template engine from processing the nodes children
  handler: function(scope){    
    /*
        The scope object has the following properties:
          module - 
          controller - 
          model - 
          view -
          $node - 
          key - 
          value -
    */
  }
});


Last edited Jun 30, 2014 at 8:35 PM by dpembroke, version 4