首页 > 解决方案 > 如何在 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;  

} 

标签: angularasp.net-coreasp.net-core-2.0

解决方案


推荐阅读