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

Re : How can I override can.Component's lookup function?

$
0
0
Basically, I'm hoping that this will create design patterns that are much more decoupled, and clearer.

This will actually make things more coupled.  The "crazy amount of attributes" is what keeps things decoupled. Your low-level components exist without knowing about the component that calls them.  Just like underscore and jQuery don't know about my app.

However, there's a need for "clearer".  Alex Osh has created an issue that would allow a child component to setup cross binding on the  parent scope.   I can't remember the actual semantics.  But it lets you have your "global" scope with a property like: ownerId: 5, and you can access that in a child component like:

can.Component({
  tag: "foo-bar"
  scope: {
    ownerId: "^"
  }
});


and create that component without attributes like:

<foo-bar></foo-bar>


Viewing all articles
Browse latest Browse all 3491

Trending Articles