Skip to content
This repository was archived by the owner on Feb 22, 2018. It is now read-only.

[WIP] Drop the @Controller #959

Closed
wants to merge 29 commits into from
Closed

[WIP] Drop the @Controller #959

wants to merge 29 commits into from

Conversation

vicb
Copy link
Contributor

@vicb vicb commented Apr 25, 2014

This is an early preview, lots of things to polish

Some TODOs:

  • Fix all demos (animation does not work yet)
  • Fix all tests
  • Discuss naming (ContextLocals)
  • Clean a few things in the code
  • Rewrite history with fewer commits, add descriptions, fix issues & BC changes

@vicb vicb added cla: yes and removed cla: no labels Apr 25, 2014
@Pajn
Copy link

Pajn commented Apr 29, 2014

With this change, to my understanding, components will be the only way to get a new scope.
Have SVG been taken into account with this change?
Components doesn't work in SVG as only tags in the SVG namspace is allowed
and thus a big app with heavy usage of SVG will need to put to much cruft in the
rootScope. Wich is more bug prone and makes testing harder.

@mhevery
Copy link
Contributor

mhevery commented May 1, 2014

@Pajn No we have not thought about SVG. Tell us more about the issues this creates. Perhaps we could modify the Components to work with SVG. I would love to hear your ideas.

@Pajn
Copy link

Pajn commented May 1, 2014

First, SVG doesn't support shadow dom. However with master this is no longer an issue.
When searching, I can see that this now works with AngularJS so this seems to be a bug
in the Component handling rather that a flaw in the concept. Maybe a new issue should be
opened for this?

But just to show the problem:
Working AngularJS example: http://plnkr.co/edit/ORXN3I?p=preview
Not working AngularDart example:

@Component(
    selector: 'svgcomponent',
    template: '<circle ng-attr-cx="{{ cmp.x }}" ng-attr-cy="{{ cmp.y }}" r="20" fill="black" />',
    publishAs: 'cmp',
    useShadowDom: false
)
class SvgComponent {
    @NgAttr('x')
    int x;
    @NgAttr('y')
    int y;
}

The template actually gets added to the DOM, but isn't rendered.

One thing that differs between AngularJS and AngularDart output is that
AngularJS replaces the custom element with the template where AngularDart
places the template inside the custom element and thus leaves a unknown
element for the SVG parser. I don't know if this is the issue or not, but it may
be worth looking into.

Here is a Stackoverflow discussing the problem that were in AngularJS
https://stackoverflow.com/questions/13641105/including-svg-template-in-angularjs-directive

@vicb
Copy link
Contributor Author

vicb commented May 1, 2014

@Pajn thanks for the extensive feedback, could you please create a separate issue to make sure we address that and it doesn't get lost. Thanks.

@mhevery
Copy link
Contributor

mhevery commented May 7, 2014

Any update on this? Is this ready to merge?

@vicb
Copy link
Contributor Author

vicb commented May 7, 2014

Not yet.

On May 7, 2014 10:43:21 PM CEST, "Miško Hevery" [email protected] wrote:

Any update on this? Is this ready to merge?


Reply to this email directly or view it on GitHub:
#959 (comment)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

Successfully merging this pull request may close these issues.

3 participants