我有两个组成部分:
UserComponent:
export class UserComponent {
@ViewChild(ProfileComponent)
profileComponent:ProfileComponent;
constructor(private userService: UserService, private confirmationService: ConfirmationService,private messageService: MessageService) {}
}
ProfileComponent:
export class ProfileComponent {
@ViewChild(ProfileComponent)
userComponent: UserComponent;
constructor(private profileService: ProfileService, private confirmationService: ConfirmationService,private messageService: MessageService) {}
}
我想在UserComponent中使用ProfileComponent并在ProfileComponent中使用UserComponent,但它无效。