Marc Hughes


Home
Blog
Twitter
LinkedIn
GitHub
about
I am a developer from a bit west of Boston.

Angular.Dart ShadowDom / applyAuthorStyles / upcoming changes

29 Apr 2014

I was floundering for a while on the Angular.dart side of things when it came to how to structure the pieces of my application.

I started off using NgComponents, and all was good. Until I tried applying CSS styles across component boundaries, and things just started falling apart due to the components using the ShadowDom. A bit of searching, and I found the applyAuthorStyles attribute, and all was good with the world again.

Some time later, I read that applyAuthorStyles is going away because it's been removed from the shadowDom spec. That breaks my solution. So I transitioned to using an NgController with an NgInclude to approximate a component, but have it actually be on the DOM. Once again, everything seemed good.

... Until I read that NgController is being deprecated and you have to use components (which will now be called Component instead of NgComponent). There goes my workaround. I was a bit worried about how I'd get everything working the way I wanted.

And finally, I saw this commit, which adds a useShadowDom property to components, letting you create the components right on the main document dom.

So I've gone full circle and am back to using @Component

I guess this is the sort of thing to expect when using a pre 1.0 framework on a relatively new language.