将ASP.NET MVC视图迁移到AngularJS 2视图/组件



我们处于迁移阶段,用于产品升级到客户端视图渲染中的最新技术。目前,我们正在使用ASP.NET MVC 4(与2012年的VS(一起使用WebApp,我们称其为中间级ASP.NET WebAPI来访问数据。这是两个单独的项目。

Web应用程序当前正在使用MVC Razor View Engine呈现前端的页面,现在我们计划将所有剃须刀视图切换到Angural2组件,并将所有客户端验证/代码从现有JavaScript/jQuery转换。到角类型。

对于Web API身份验证,我们正在使用MiCROSOFT提供的中间件 OWINKATANA实现(基于令牌的身份验证和授权(。

怀疑:

1.Since angular is preferred for single page application , is it feasible to replace the existing dynamic MVC razor view to angular
component/View .
2.Does angular supports the Owinkatana middleware for web api authentication.
3.Because of anular2 implementation we need to move our development environment from IDE VS 2012 to 2015. VS 2015 offers a very good support to angularJS2 ,typescript,node and npm .Aslo VS 2015 is completely offers a new framework (asp.net core ) does it affect our application built in .net framework 4.5.

请让我们知道是否有上述方法的瓶颈。

您在这里没有编码问题,但是,以下是一般观察

  1. 当您从MVC转到Angular时,您将必须将服务器控件(例如网格,Html.TextBox等(替换为普通HTML。建议用Angular编写新指令
  2. 您将必须使用现有的Web API,它可以与Owin Middlewares一起使用,但是您将使用JWT Bearer或其他方法,而不是在单个应用程序中使用Web App和API
  3. 升级Visual Studio是一个编辑器的偏好,与您的代码无关。

如果您有任何编程问题或需要我们提供帮助的挑战,请在此处发布。

最新更新