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
Post a Comment