title: Security and localization using Angular in a Single Page Application?
body: <p>I am investigating creating Single Page Applications using the following stack (open to suggestions here)</p>
  
  <ul>
  <li>Angular</li>
  <li>JQuery</li>
  <li>ASP.Net MVC 4</li>
  <li>Entity Framework 5</li>
  </ul>
  
  <p>I am pretty much sold on this stack and angular but there are a couple of things that I am unsure of. Different users have different roles and we will need to be able to hide/show certain pages and/or controls on pages depending on the role. I am familiar with some solutions for more traditional web applications but I am not sure where I would start when it comes to a single page application. </p>
  
  <p>I was hoping to not use MVC partial views but rather only send and treat the server code like a WebApi. But then angular would have to handle all the templates and that would mean that someone would have access to the template on the front end and might be able to figure out to call functions that they shouldn't? Or should I be checking the role in the WebAPI methods and making sure that they have the right role?</p>
  
  <p>The next problem is localization. We will need to support multiple languages. I was hoping that we could just have different languages files, en_gb.XML and that would contain keys and their various translations. Then if the user changed the language i would maybe just be able to change something in angular perhaps using value</p>
  
  <pre><code>angular.value("language", 'en_gb.js');
  </code></pre>
  
  <p>or </p>
  
  <pre><code>angular.value("language", 'en_gb.xml');
  </code></pre>
  
  <p>Has anyone else solved these sorts of problems.</p>