Skip to content

Instantly share code, notes, and snippets.

@vicatcu
Last active August 26, 2016 14:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vicatcu/2ef2c7ba1e006d70997c0577f9395206 to your computer and use it in GitHub Desktop.
Save vicatcu/2ef2c7ba1e006d70997c0577f9395206 to your computer and use it in GitHub Desktop.
<div class="menu">
<div class="item" *ngFor="#unt of unitOpts" (click)="changeUnits(unt)">
<div [innerHTML]="unt.formatted" data-tooltip="{{unt.tooltip}}" data-position="right center"></div>
</div>
</div>
produces...
browser_adapter.ts:74 EXCEPTION: Error: Uncaught (in promise): Template parse errors:
Can't bind to 'tooltip' since it isn't a known native property ("pts" (click)="changeUnits(unt)">
<div [innerHTML]="unt.formatted" [ERROR ->]data-tooltip="{{unt.tooltip}}" data-position="right center"></div>
"): ChartComponent@25:67
<div class="item" *ngFor="#unt of unitOpts" (click)="changeUnits(unt)">
<div [innerHTML]="unt.formatted" data-tooltip="" data-position="right center"></div>
{{unt.tooltip}}
</div>
<div class="menu">
<div class="item" *ngFor="#unt of unitOpts" (click)="changeUnits(unt)">
<div [innerHTML]="unt.formatted" [attr.data-tooltip]="unt.tooltip" data-position="right center"></div>
</div>
</div>
ref: https://angular.io/docs/ts/latest/guide/template-syntax.html#!#attribute-binding
note: this breaks if you chant `#unt` to `let unt`
Note: This is in 2.0.0-beta.15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment