S
S
Sergey Zelensky2016-04-26 10:17:16
Angular
Sergey Zelensky, 2016-04-26 10:17:16

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

1 answer(s)
N
Nicholas, 2016-04-26
@SergeyZelensky-Rostov

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 question

Ask a Question

731 491 924 answers to any question