1

I have my custom decorator like from the tutorial which adds HTML code to a page. But if HTML code contains my custom component it will not be processed by AngularDart. How can I add a processed component from a decorator?

Günter Zöchbauer
  • 623,577
  • 216
  • 2,003
  • 1,567
Sergey
  • 425
  • 1
  • 4
  • 11
  • possible duplicate of [angular.dart how to create a custom component programmatically and add to page?](http://stackoverflow.com/questions/23184009/angular-dart-how-to-create-a-custom-component-programmatically-and-add-to-page) – Günter Zöchbauer Aug 05 '14 at 09:23

1 Answers1

1

Components can't be added dynamically. Instead, use ng-hide with a bool value to toggle it. Then you can use your decorator to update the value upon your needs.

youssef
  • 493
  • 3
  • 11
  • In fact components can be added dynamically. This is done in many places (for example views) See my answer here http://stackoverflow.com/questions/23184009 for an example or this Q/A http://stackoverflow.com/questions/20423565 (may be a bit outdated because of continually changing AnguldarDart API). – Günter Zöchbauer Aug 05 '14 at 09:22