Skip to content

Commit

Permalink
Use ngStyle
Browse files Browse the repository at this point in the history
  • Loading branch information
czeckd committed Mar 21, 2016
1 parent 0ede8bb commit a32cae5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/demo-app.component.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import {Component} from 'angular2/core';
import {NgStyle} from 'angular2/common';

import {SvgIconComponent} from './svg-icon.component';

@Component({
Expand Down Expand Up @@ -27,7 +29,7 @@ import {SvgIconComponent} from './svg-icon.component';
</fieldset>
<label>width:</label> <input type="number" min="0" max="1000" [(ngModel)]="w"><label> px</label>
</form>
<div [style]="getStyle()">
<div [ngStyle]="{'width': w + 'px', 'fill': 'rgb(' + r + ',' + g + ',' + b + ')' }" >
<svg-icon src="images/eye.svg"></svg-icon>
</div>
<tt>&lt;div style="{{getStyle()}}"&gt;<br/>
Expand Down

0 comments on commit a32cae5

Please sign in to comment.