Reputation: 2256
I have upgraded from Angular2 beta to RC1
attr.style is not working properly, there is no error but this style is not coming
<div class="hotspot_info pointer" attr.style="top: {{towerPoint.posY}}%; left: {{towerPoint.posX}}%;" >
Upvotes: 1
Views: 63
Reputation: 3700
import :
import {NgStyle} from '@angular/common';
set directive :
directives: [NgStyle]
then try:
<div class="hotspot_info pointer" [ngStyle]="{top: towerPoint.posY+'%'+; left: towerPoint.posX+'%'}" >
Upvotes: 2
Reputation: 1507
The ngStyle directive allows you to set CSS style
<div class="ng-style: expression;"> ... </div>
Upvotes: 0
Reputation: 202196
I would use the ngStyle
directive instead:
<div class="hotspot_info pointer"
[ngStyle]="{top: towerPoint.posY + '%', left: towerPoint.posX + '%'}" >
Upvotes: 2