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

ios - Is 'init' forbidden as *part* of a variable name? -

angular - Angular2 Router: Cannot find primary outlet to load 'HomeComponent' -

qt - Microsoft FTP Service 451 The parameter is incorrect -