I want to avoid delays in displaying the original views processed by JavaScript. I want the user to immediately see the content and Angular takes it from there. I do not want to just replace this ng-view when Angular ngRoute is triggered, as this can happen. I just want it to replace it when the user dialed another route.
Suppose this is a basic route '/'. This would already be in my HTML displayed from the server.
<div ng-view>
<h1>Welcome. I am the first view.</h1>
<p>Please do not replace me until a user has triggered another route.</p>
</div>
I know that the general approach is to have some server-side code in ng-view, and when loading Angular it just replaces it. This is not what I am looking for. I want Angular to download and understand that this is actually my first submission.
Any creative ideas on how to do this? I looked at the source code - no luck. Perhaps there is even a way to have Angular replace HTML only if it is different.
Edit: I do not want to display server-side templates for use as Angular templates. I am looking to display all of mine index.htmlon the server side, and this will already contain everything that the user should see for this initial base route.
source
share