Questions tagged [lifecycle-hook]
42 questions
0
votes
1 answer
Do we need afterViewInit lifecycle hook anymore in angular?
We know that the afterViewInit lifecycle hook gets triggered once when a component finally finishes the initialization of it's view. Thus if any component has to work with it's viewChild, this lifecycle hook get's it's relevance to be invoked inside…

Rezaul Karim
- 1
- 1
0
votes
0 answers
vue created doesn´t fire when a new element is inserted
I´m new to vue, and struggle with a - for me - strange behaviour.
I expected that every time a new "singleMessage" is inserted in the dom, the functions in "created" will be executed. But it doesn´t.
My goal is that every time a new single message…

Daniel Hüpenbecker
- 23
- 4
0
votes
1 answer
How can I remove manually added event listeners on beforeDestory hook of one component before redirecting to any another component, in Vuejs2?
I want to know the concept of the below thing-
I have created one component and set up its respected event listeners. Now, I want to remove those listeners on this component's beforeDestroy hook before redirecting to another route that will create…

Neha Soni
- 3,935
- 2
- 10
- 32
0
votes
1 answer
AWS Autoscaling delay launch and terminate
I have the following scenario and need to know the best way to achieve it in AWS.
I have an EC2 autoscaling group which will initially be set to 0, after a manually run process an SSM document is triggered which sets the ASG to 3, however I need…

Nexus490
- 319
- 1
- 4
- 14
0
votes
1 answer
nativescript-vue cannot read data property in lifecycle hooks
im reading nfc tags through my created hook and I would like to pass them to my data properties.
It shows me that I cannot read or set the property 'currentArticle'. I tried suggestions like
let self = this
self.currentArticle
but it did not…

Ifloop
- 129
- 11
0
votes
1 answer
get PreStop lifecycle hook execution results
i'm trying to find out how to get preStop execution result for debugging purposes.
I'm creating a pod (not part of a deployment) with the following lifecycle definition:
terminationGracePeriodSeconds: 60
lifecycle:
preStop:
…

Lior Baber
- 852
- 3
- 11
- 25
0
votes
0 answers
adding class to an element in Vuejs component modifies all instances of that component
I wrote a mounted function to conditionally add and remove classes from an element in a Vuejs component. It appears that the function adds the class to the element in not only this instance of the component but in all instances of that component.…

GNG
- 1,341
- 2
- 23
- 50
0
votes
0 answers
"ExpressionChangedAfterItHasBeenCheckedError"; I don't understand what type of operations which are inside the lifecycle hooks, make it to be thrown
It's important to me due to certain reasons, to understand how Angular works; well;
One thing that I can't understand, is the error that's mentioned in the title, and what things I'm prohibited by Angular to do inside the lifecycle hooks (if there…

Idan Steinberg
- 11
- 1
0
votes
1 answer
service that runs at angular app instance creation regardless of inital router endpoint
I have an authentication service that I want run on app instance creation. Im not sure how to do this.
One of the many things that this service will do is check if localstorage contains a JWT (I am using a angular app so I am protected from xss)…
user9487981
0
votes
2 answers
lifecycle hooks of input population from sibling component angular2
I have two siblings component like below
when user click on…

Paridokht
- 1,374
- 6
- 20
- 45
0
votes
1 answer
Calling detectChanges() inside Angular2 lifecycle hooks?
What I know, is that we call detectChanges() to trigger local change detection checks. I have seen some code that detectChanges() is called inside ngOnChanges(change) hook and I was wondering why would someone want to do something like this? I mean,…

koninos
- 4,969
- 5
- 28
- 47
-1
votes
1 answer
Angular Lifecyclehook ngOnChanges
I want to update a variable each time after it changes in angular view.
How can it be achieved in angular without using @input decorator?

sabin shrestha
- 189
- 8