Consider the following piece of Angular2 code:
<li *ngFor='let department of departments' value='{{department.id}}'>{{department.name}} {{department.id}}</li>
When I run it in the browser, it renders the following html (cleaned up for clarity):
<li value="-1677026285">Dept1 2617941011</li>
Notice that the same variable, department.id is rendered as its actual value of 2617941011 in the text portion of the li, but as something entirely different in the value attribute (looks like it attempted to parse that string as an integer).
Is there any way to avoid it?
I will add that the Department class (of which departments is an array of) specifies id as a strongly typed property:
export class Department {constructor(public name:string = "", public id:string = ""){ }}
Thanks in advance!