如何在MVC 5加载HTML页面Angularjs路由? [英] How to load HTML page in MVC 5 for Angularjs routing?

查看:156
本文介绍了如何在MVC 5加载HTML页面Angularjs路由?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想用angularjs的SPA概念MVC 5,但不能处理路由。我希望我的主网页来查看剃刀并加载使用angularjs页面的部分。
我知道我的描述是不够的,但希望有人帮助我度过。
先谢谢了。

I want to use the SPA concept of angularjs in MVC 5, but cant handle the routing. I want my main page to view in Razor and load portion of the page using angularjs. I know my description is not sufficient but hope anyone will help me through. Thanks in advance.

推荐答案

看项目模板AngularStart

Look at the project template AngularStart

https://visualstudiogallery.msdn.microsoft.com/cc6c9c5f-2846-4822-899f-a6c295cd4f2b

我这个模板的作者,它展示了如何可以客户端的路由和路由MVC可以组合。这已经为MVC 4创建的,但你会得到一个想法。

I am author of this template and it shows how can client side routing and mvc routing can be combined. This has been created for MVC 4, but you will get an idea.

我还创建了一个博客帖子的http://blog.technovert.com/2013/12/setting-up-angularjs-for-asp-net-mvc-n-webapi-project/解释的方法。

I also created a blog post http://blog.technovert.com/2013/12/setting-up-angularjs-for-asp-net-mvc-n-webapi-project/ explaining the approach.

这篇关于如何在MVC 5加载HTML页面Angularjs路由?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆