Angular2 dynamic change CSS property

1) Using inline styles <div [style.color]=”myDynamicColor”> 2) Use multiple CSS classes mapping to what you want and switch classes like: /* CSS */ .theme { /* any shared styles */ } .theme.blue { color: blue; } .theme.red { color: red; } /* Template */ <div class=”theme” [ngClass]=”{blue: isBlue, red: isRed}”> <div class=”theme” [class.blue]=”isBlue”> Code samples … Read more

How to add a component programmatically in Angular.Dart?

The API has changed in AngularDart 0.9.9: BlockFactory now is ViewFactory scope.$new now seems to be scope.createChild(scope.context) injector.createChild(modules) now requires a list of modules (instead of a single one) AngularDart 0.10.0 introduces these changes: NgShadowRootAware not is ShadowRootAware ..value() now is ..bind(., toValue: .) So the code of pavelgj now looks like so: class AppComponent … Read more