As I make my way through the tutorial, an interesting scenario has arisen.
I've noticed that when injecting a service into my component without specifying an access modifier, it results in an error as shown below. However, adding either "private" or "public" fixes the issue.
Is there no default scope in Angular if we forget to specify the access modifier?
export class UserDetailsComponent implements OnInit {
name="";
lastName="";
constructor(userService : UserServiceService) { }
ngOnInit() {
}
save(){
this.userService.saveUser();
}
}
Property 'userService' does not exist on type 'UserDetailsComponent'.