2

I have been using the answer from this

AngularDart: How to include subcomponents in a custom component template

Using something similar to this:

<tabs>
  <tab>some tab content</tab>
  <tab>another tab</tab>
</tabs>

My constructor for Tab is like

Tab(Tabs tabs) {
   tabs.add(this);
}

This would let me create a "Tabs" component and add the child "Tab" to the a list of tabs in the the Tabs controller.

Up until AngularDart 0.14.0, but with 1.0 the component passed to the constructor of the child is now null and cannot be added to the parent.

Anyone know how to now achieve the same in AngularDart 1.0.0?

Community
  • 1
  • 1
reven
  • 330
  • 4
  • 14

1 Answers1

2

OK it turns out that the issue was more around the Scope being injected and also the fact that "Controllers" are now "Components", which means you have to set the templateUrl, or template html to render the content.

Simply replacing Controller with a Component wont work you need to shift all the html code to a template file.

reven
  • 330
  • 4
  • 14
  • When moving to Components you have to be aware of shadowDom vs lightDom differences. However, the injection example as written in your original post should work in both light and shadow Dom sub-components in v1.0. – Rado Nov 11 '14 at 02:58