调试Angular2应用程序 [英] Debugging Angular2 applications

查看:75
本文介绍了调试Angular2应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我写了一个angular2组件示例,其中最初关闭了标签 模板中缺少"h2"元素

I have a written a sample angular2 component in which initially closing tag for "h2" element was missing in the template

@Component({
selector:'rx2',
template: `
<div><h2> RX2 component</h2></div>
`
})

在浏览器中执行应用程序时,仅以下错误描述是 显示在控制台中.

And while executing the application in browser,only below error description was displayed in console.

directive_normalizer.js:106未捕获的错误:模板解析错误:(...)

directive_normalizer.js:106Uncaught Error: Template parse errors:(…)

因为这是一个很小的组件,模板只有1行, 我能够找出问题并加以解决,我的问题是,如果有更大的模板,有没有更简单的方法来识别此类问题.

Because this is a small component with only 1 line for template, I was able to identify the issue and fix it, my question is , is there any simpler way to identify such issues in case of a bigger templates.

推荐答案

您可以使用以下技术

步骤1 -单击(...)

第2步-查找错误

这篇关于调试Angular2应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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