Skip to content
Advertisement

Tag: angular13

ViewChild is undefined in angular 13

I am trying to call view child of a child component from parent and getting undefined in the console. see the image also see the stack blaze for the same https://stackblitz.com/edit/angular-ivy-k4m2hp?file=src%2Fapp%2Fhello.component.ts Please help to get the child component this.testChildComponent So that i can call ngOnInit of child from parent. this.testChildComponent.ngOnInit() Answer if you set your viewChild { static: true }

What is the proper way to update a parent component with a shared service in ngOnInit – Angular 13

I’ve come across a situation a few times where I use a shared service in a component’s ngOnInit to update a value in another component, which just so happens to be a parent. This results in the infamous Error: NG0100: Expression has changed after it was checked in development mode, and change detection will not pick up the change. I

Unable to call a JS function from Typescript in Angular 13

I’m trying to call the following function, LoadMultiSelect(), from one of my components because I am using a non-Angular library: https://ibnujakaria.github.io/multiple-select-js/ This works perfectly in the console: And loads the JS component. Later, I try adding it in Angular, but I cannot find how to. I tried to export the JS function in two ways: And like this: I created

Advertisement