如何获取Angular编译错误以在Build for Net Core应用程序中显示?

时间:2018-10-22 00:09:29

标签: angular asp.net-core asp.net-core-2.0

我正在创建一个Net Core Angular应用程序。这是一个默认的Net Core Template项目。我在实际的打字稿文件中看到了编译错误,但是在构建项目时看不到它们是错误。

如何在“构建输出”窗口中将它们显示为错误?
我试图模仿这个项目,我故意放置错误的目录来创建一个错误,并将其显示在构建中。

https://ankitsharmablogs.com/asp-net-core-crud-using-angular-5-and-entity-framework-core/

enter image description here 谢谢,

文件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;  

} 

0 个答案:

没有答案