Answer the question
In order to leave comments, you need to log in
What if I load content right away?
Please tell me, if I load content immediately from the server, how should I deal with routing?
I managed to come up with only such trash, but I suspect that this is trash.
<div class="content" id="content" ng-view autoscroll="true" ng-class="{loading: loading}">
<?= $content ?>
</div>
App.run(function($location, $templateCache){
$templateCache.put($location.url(), angular.element('#content').html());
});
Answer the question
In order to leave comments, you need to log in
http://angular.ru/api/ng.directive:script . The example there is non-working, corrected in the comments .
It can be done in the form of a generated js-ki, into which to cram all the necessary templates through $templateCache.put(...).
Why do you need angular then?
you can do everything right, and provide ready-made data via $httpCache, supposedly a separate module generated by the server, which defines the service with a ready-made cache, which will later be used as the default for http requests.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question