I am working on an angularJs and typescript project. I have to make a synchronous http call and get some data from the server before starting the client application and loading the user interface. I search the Internet and see how everyone talks about the promise, well, well, why not. So I use the promise (make $ http call and use $ q to return the promise) in my app.run (). Maybe Iβm not losing anything because it doesnβt work at all. Angular run app.config (), then app.run (), ... But Angular did not wait for app.config () to complete before running app.run (). So, my first promise runs in app.run (), and before it allows Angular to try to instantiate the controller ... I don't want to create a new httpSynchronous service call, but I have no other ideas.
source share