angular - 如何在 Build for Net Core 应用程序中显示 Angular 编译错误?
问题描述
我正在创建一个 Net Core Angular 应用程序。这是一个默认的网络核心模板项目。我在实际的打字稿文件中看到了编译错误,但是在我构建项目时不要将它们视为错误。
如何在 Build Output 窗口中将它们显示为错误?
我试图模仿这个项目,我故意通过放置不正确的目录来创建一个错误,并让它在 build.xml 中显示。
https://ankitsharmablogs.com/asp-net-core-crud-using-angular-5-and-entity-framework-core/
文件 fetchemployee.component.ts
import { Component, Inject } from '@angular/core';
import { Http, Headers } from '@angular/http';
import { Router, ActivatedRoute } from '@angular/router';
import { EmployeeService } from '../../../Serviceswrongdirectory/empservice.service'
//import Empserviceservice = require("../../../Services/empservice.service");
//import EmployeeService = Empserviceservice.EmployeeService;
@Component({
templateUrl: './fetchemployee.component.html'
})
export class FetchEmployeeComponent {
public empList: EmployeeData[];
constructor(public http: Http, private _router: Router, private _employeeService: EmployeeService) {
this.getEmployees();
}
getEmployees() {
this._employeeService.getEmployees().subscribe(
data => this.empList = data
)
}
delete(employeeID) {
var ans = confirm("Do you want to delete customer with Id: " + employeeID);
if (ans) {
this._employeeService.deleteEmployee(employeeID).subscribe((data) => {
this.getEmployees();
}, error => console.error(error))
}
}
}
interface EmployeeData {
employeeId: number;
name: string;
gender: string;
city: string;
department: string;
}
解决方案
推荐阅读
- node.js - NextJS 和 KeystoneJS 网站无法获取 GraphQL 数据(错误:没有名为“public”的可执行架构可用)
- tensorflow - BERT 模型微调和迁移到 TF2
- python - 运行长度解压python
- java - 语法错误,插入“Dimensions”以完成 TypeArgument
- anaconda - Anaconda Navigator:有没有办法查看控制台?
- python - Python:类内的函数范围
- apache - 使用 .htaccess 重定向 404 而不重定向尾部斜杠
- android - Android Volley JsonObjectRequest 超时,但显式 IP:端口请求有效
- react-native - 如何按月份和年份对数组进行分组 React Native
- nested - Protobuf-c:在消息中嵌套消息会创建一个结构指针