title: Razor templates, views and angular.js
body: <h1>TL;DR</h1>
  
  <p>What are the best practices when using .NET Razor views and AngularJS?</p>
  
  <h1>Context</h1>
  
  <p>We are developing a <strong>public website</strong> (not an intranet application) using mvc4 with razor, and we weren't very familiar with client script, so we started with what we knew: jQuery.
  But now things are getting more complicated and we'd like to switch to AngularJS.</p>
  
  <p>On the .NET part, we use Razor templates and <code>UIHintAttribute</code> (plus some custom ones) to render the right html "control". We also add custom html attributes to give extra information to the jQuery part (like <code>title</code> for a tooltip....)</p>
  
  <p>So we already use a declarative way of setting the user interface behavior, that's why AngularJS seems a good option.</p>
  
  <h1>Questions</h1>
  
  <p>Since we already have models defined server side, and since AngularJS also uses models, wouldn't it force us to duplicate code?</p>
  
  <p>How do we deal with data binding feature, since we already do some binding server side (in the views). Should we make a completely asynchronous application, making AJAX calls from AngularJS to load data, or can we mix both?</p>
  
  <p>Anything else we should be aware of when trying to use both of these technologies?</p>
  
  <p>I did some research on Google, but I can't find detailed ways of mixing Razor views and templates with AngularJS... Perhaps that's just not a good thing to do?</p>