Asp.Net MVC和AngularJS在同一视图 [英] Asp.Net MVC and AngularJS in same View
问题描述
我倒是想知道是否存在更好的方式来呈现这样的观点:
对于第一个负载,我需要从控制器平常一样将数据,但适用于同一页面过滤我需要开始使用AngularJS,绝不多用剃刀之后。
有没有办法做到这一点?
感谢所有。
I´d like to know if exists a better way to render a view like this: For the first load I need bring data from Controller like usual but after apply a filter in same page I need to start use AngularJS and never more uses Razor. Is there a way to do that ? Thanks for all.
推荐答案
有实现ASP.Net MVC与AngularJs多种方式。
There are multiple ways to implement ASP.Net MVC with AngularJs.
我个人喜欢迷你SPA(筒仓)。你可以看米格尔卡斯特罗的视频 rel=\"nofollow\">。
I personally like Mini SPA (Silos). You can watch Miguel A Castro's video here.
您还可以在自己的网站下载源。
You can also download the source at his website.
在收到请求时,它进入ASP.Net MVC路线首先它所做的是。然后,角路线接管休息。这是一个非常漂亮的设计。
What it does is when a request comes in, it goes to ASP.Net MVC Route first. Then, Angular Route takes over the rest. It is a very slick design.
FYI:的我也用的 Angular.Net助手生成强类型的意见。
FYI: I also use Angular.Net Helpers to generate strongly typed views.
这篇关于Asp.Net MVC和AngularJS在同一视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!