Answer the question
In order to leave comments, you need to log in
How are templates connected to routers arranged in angular?
Hello, I'm interested in exactly how angular gets the html template and inserts it into ng-view
Thank you in advance
Answer the question
In order to leave comments, you need to log in
Look at this answer of mine, it describes the mechanism of the router.
If the question is about the insertion process - Angular performs a GET request to the template address (which it takes from the routes config) and then inserts it inside the element (ng-view). At the same time, the angular has a templateCache, and before the request is executed, a check is made to see if we have already loaded this template.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question