I have read (I don't remember where) that it's not recommendable injecting 
the "host" element directly to the constructor:

class MyComponent {
  // discouraged?
  MyComponent(ElementRef hostRef) {...}
}


Instead, it's better to use the @VideChild directive:

class MyComponent {
  @ViewChild('myElement')
  ElementRef myElement;
}


But why? Why is not recommendable injecting the host element directly to 
the constructor?
Thanks.

-- 
You received this message because you are subscribed to the Google Groups 
"angular-dart" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular-dart+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/angular-dart.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/angular-dart/5fe52d7f-59c2-48af-ba4f-ea517867d057%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to