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

Re : Declaring default attributes from upper level scopes

$
0
0
you can overwrite the scope property to do pretty-much whatever you want:

look at scope's 

function(attrs, parentScope, element)


signature


scope: function(attrs, parentScope, element){
  return new can.Map({
    dict: parentScope.attr('dict')
  })
}

I'm not sure about using dict: "@dict"

It's possible that we'd want to allow name: "@title" to read an attrs value other than name and set that as the name property.  

A different identifier is needed to set something up like this.  I'm betting angular has something similar ... what do they do?
 

Viewing all articles
Browse latest Browse all 3491

Trending Articles