title: AngularJS best practice - Templates vs Javascript
body: <p>Per default, Angular fetches the HTML templates from the server when the user navigates to a route. With that in mind, imagine this scenario:</p>
  
  <ul>
  <li>User loads the Angular app. The main view has a subpage called "Order".</li>
  <li>While the user is studying the main view a new version of the app is rolled out in production. The new version has a complete rewrite of the Order page with new Javscript and HTML.</li>
  <li>The user navigates to the Order page. The Javascript is already loaded by the browser in step 1, so the user is on the old version until app is reloaded. <strong>But the new template gets fetched from the server on navigation</strong>. So now the Javascript and template are our of sync!</li>
  </ul>
  
  <p>Is my assumption that the Javascript/HTML is out of sync, correct?</p>
  
  <p>If so, are there any best practices related to this issue?</p>
  
  <p>I guess one solution is the make Angular fetch all the templates on app initialization. But this could be a performance penalty if the app has hundreds of HTML views.</p>