使用MVC 4实现AngularJS [英] AngularJS implementation with MVC 4

查看:80
本文介绍了使用MVC 4实现AngularJS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



我对AngularJS很新。想在我的一个新的MVC 4 Web应用程序中使用angularjs。



我可以使用Angular JS以及使用它的优势。如果我使用angularjs,它会改变MVC结构。请提供宝贵的建议。





谢谢,

Srinivas

Hi All,

I am very new to AngularJS. Want to use angularjs in one of my new MVC 4 web application.

Where I can use Angular JS and what is the advantage of using it. If I use angularjs, will it change MVC structure. Please provide your valuable suggestions.


Thanks,
Srinivas

推荐答案

我也在学习AngularJS。



我指的是以下文章,我发现这非常有效。所以这也可以帮助你。< br $> b $ b

AngularJS和ASP.NET MVC入门 - 第一部分 [ ^ ]

AngularJS和ASP.NET MVC入门 - 第二部分 [ ^ ]

[ ^ ]
I am also learning AngularJS.

I am referring following articles and I find this very effective.So this might also help you.

Getting started with AngularJS and ASP.NET MVC - Part One[^]
Getting started with AngularJS and ASP.NET MVC - Part Two[^]
Getting started with AngularJS and ASP.NET MVC - The long awaited Part Three[^]


如果你从头开始一个项目,我不推荐使用MVC方法。你的理由是什么? Angualar它的自我是一个MV *框架。我就像你的做法那样做了。但最后我删除了整个MVC的东西,因为它不仅仅是一个锅炉。

如果你只想向授权用户发送一些视图我会建议这样做(比你可以使用)例如asp.net身份)



我会在多个项目中分离你的解决方案。

项目1:普通网站你创建一个没有MVC开销的单页面应用程序。

项目2:如果你需要一些数据,可以保存你的Web API或SignalR服务。



问候

Stibe
If you start a project from scratch I would not recommend the MVC approach. Whats your reason for this? Angualar its self is a MV* Framework. I did this in the like your approach. But at the end I removed the whole MVC stuff because it was not more than a boiler.
I would only recommend to do this if you like to send some views only to authorized users (than you can use asp.net identity for example)

I would separate your "Solution" in multiple project.
Project 1: "Plain Website" where you create a Single-Page application without MVC overhead.
Project 2: Can hold your Web API or SignalR services if you need some data.

Regards
Stibe


AngularJS可用于客户端(用户界面)。使用angularjs的主要优点是动态的。如果您在Javascript或Html中更改变量,那么它将在我们使用的任何地方立即更改。





angularjs不会改变你的mvc结构。 AngularJS也是一个MVC框架。有关更多参考,请参阅angulardoc。
AngularJS can be used in client side (User Interface). The main advantage of using angularjs is dynamic. If you change the variable either in Javascript or Html, then it will change immediately wherever we used.


The angularjs will not change your mvc structure. AngularJS is also a MVC framework. For more reference kindly refer angulardoc.


这篇关于使用MVC 4实现AngularJS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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