javascript - How to access Angular 2 object's attribute -


export class dashboard {     checked: object = {users: false, device: false}     boxclicked(){         if(checked.users){             console.log("clicked users");         }     } } 

property 'users' not exist on type 'object'. why?

you saying checked: object = {users: false, device: false} means members defined 'object' (the interface) visible. can not access 'users'.

you should checked: = {users: false, device: false}


Comments

Popular posts from this blog

sequelize.js - Sequelize group by with association includes id -

android - Robolectric "INTERNET permission is required" -

java - Android raising EPERM (Operation not permitted) when attempting to send UDP packet after network connection -