Answer the question
In order to leave comments, you need to log in
Is delayed function call possible in Angular?
Good afternoon!
Is it somehow possible in angular to call a function with a time delay or in some other way? The bottom line is that there are, let's say, two pages, each with its own controller. It is necessary for me that when I click on a button on one page (I make a redirect via $location.path('/second_page')), I go to the second page and the function from the controller of this second page is simultaneously called. Is it possible to do so? Now it turns out that the redirect is happening, but when the function is called, an error occurs, they say, I don’t know such a function.
Answer the question
In order to leave comments, you need to log in
Put the desired function before $location.path('/second_page')). After $location.path functions are not processed. You are automatically transferred to a new controller and all actions take place already there.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question