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

Combining attribute passing and binding types

$
0
0
The problem I see now with declaring how attributes passed and bound is a little lack of flexibility. Well maybe this constrains which only helps and flexibility of any level can be achieve using scope's creation function.

But I will explain:

declaring height attribute:

scope: {
      height: '@',   
}

This will only allow passing data via elements attribute.

In one case I may want to declare height statically (and assuming that DOM mutaion support is coming it is actually not so static)

<my-component height="20"></my-component>

But in another case I may want to use parent's scope binding for the same component

<my-component height="myComponentHeight"></my-component>

So what do you think?

Viewing all articles
Browse latest Browse all 3491

Trending Articles