I am working with Angular 2 and TypeScript, but I am encountering NaN in the option tag.
In my app.component.ts file:
export class AppComponent {
rooms = {
type: [
'Study room',
'Hall',
'Sports hall',
'department room',
'Service room',
'Restroom']
};
In my app.component.html file:
<select placeholder="Select an option">
<option *ngFor="let room-type of rooms.type">{{room-type}}</option>
</select>
I am having trouble debugging this issue as I am unable to debug interpolation or binding operations. I have tried searching on Google and Bing, but haven't found a solution yet.
I am using Visual Studio Code on Windows 10.
Here is how it looks:
https://i.stack.imgur.com/6MbVc.png
I suspect that TypeScript may be the cause of this problem, as it seems like the code is expecting number variables but receiving something else...