Using Razor and Angular.js in MVC4

In the project I'm working on, our MVC4 website uses a combination of Razor and Angular.js. I'm new to the web development interface, so I'm confused if this is a good idea or not. What are the advantages and disadvantages of mixing them, and what are some of the scenarios that use both of these methods make sense?

+7
source share
1 answer

I can share my experience with AngularJS + MVC4 / Razor: we use Razor only for localization - therefore, only the Razor function "@somekeyword" is allowed. As a result, on the client side, we got localized AngularJS templates. This allows for maximum caching (even using CDNs).

As for MVC4, we use the ASP.NET Web API to send JSON data. We have a developer extension for sending HAL responses (Hypermedia).

This gives maximum isolation and the ability to change to another server, if necessary.

+6
source

All Articles