使用Visual Studio 2015调试Angular 2.0吗? [英] debug Angular 2.0 with Visual Studio 2015 ?

查看:65
本文介绍了使用Visual Studio 2015调试Angular 2.0吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

不确定这是否是问的正确地方.

Not sure if this is the right place to ask.

问题在于如何使用Visual Studio 2015调试Angular 2.0应用程序.似乎VS无法识别Angular应用程序中的延迟加载文件,因此无法中断和调试代码.

The problem is how to debug an Angular 2.0 app with Visual Studio 2015. It seems VS is not aware of the lazy loaded files in the angular app, and therefore is unable to break and debug the code.

自12月初以来,我还没有尝试过Beta版,但是现在,当angular越来越接近发布时,我想回到VS进行开发.

I haven't tried since early december, pre beta, but now when angular is getting closer to release I would like to move back to VS for development.

推荐答案

您好,jkristia,

Hi jkristia,

我下载了Angular 2.0应用示例,并尝试使用Visual Studio 2015.

I download a Angular 2.0 app sample and try working with Visual Studio 2015.

首先,请通过菜单File->用Visual Studio 2015打开Angular 2.0应用.打开->网站.因为Angular 2.0应用程序没有解决方案文件.

First, please open your Angular 2.0 app with Visual Studio 2015 from menu File -> Open -> Web site. Because the Angular 2.0 app doesn't have solution file.

我发现Angular 2.0应用程序中只有一些js文件和html文件.因此,我们的目的是在此应用中调试这些文件.

I find that there just some js files and html files in Angular 2.0 app. So our purpose is debugging these files in this app.

对于html文件,我们通常按照以下步骤通过浏览器对其进行调试.

For html files, we often debug them through browser with below steps.

  1. 打开一个要在Visual Studio 2015中调试的html文件.
  2. 右键单击该html文件,选择在浏览器中查看(Internet Explorer)".该html文件在浏览器中打开.
  3. 在浏览器中按F12打开开发人员工具以调试您的html文件.

对于js文件,请使用与上述相同的步骤.您还可以在js文件中添加断点.在运行时会中断.

For js files, please using the same steps as above. You also can add breakpoint in js file. which will be break at runtime.

如果还有其他问题,请随时告诉我.

If any other questions, please feel free to let me know.

最好的问候,
Weiwei

Best Regards,
Weiwei


这篇关于使用Visual Studio 2015调试Angular 2.0吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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