问题
I'm creating an app with angular 6 but I facing a strange error when I try to run any build command: 1- ng build 2- ng build --prod 3- ng build serve
Error:ERROR in HostResourceLoader: loader(F:/Spark/Spark Apps Development/doPayroll Front-End/doPayroll Front-End/src/app/getstarted/getstarted.component.html) returned a Promise
Also, the error show on the following image
It's strange that the error solve and the app run when I press ctrl+s to any ts file, it resume compiling and run successfully at the end.
But now I need to deploy my app and now I facing this issue in the cloud.
So please if any one can help, this proplem takes from me more than it deserves.
Update
getstarted.component.html
<app-firstheader></app-firstheader>
<br>
<div class="main">
<div class="welcome">
<p [translate]="'getstarted.title'">
</p>
</div>
<hr class="underline">
<img width="300" src="assets/img/welcome.png">
<p class="welcome2" [translate]="'getstarted.body'"></p>
<button (click)="next()" class="button button4" [translate]="'getstarted.next'"></button>
</div>
<br>
<app-footer></app-footer>
getstarted.component.ts
import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router';
import { TranslateService } from '@ngx-translate/core';
@Component({
selector: 'getstarted',
templateUrl: './getstarted.component.html',
styleUrls: ['./getstarted.component.css']
})
export class GetstartedComponent implements OnInit {
constructor(private router: Router) {}
next(){
this.router.navigate(['/presignup']);
}
ngOnInit() {
}
}
Thanks in advance.
来源:https://stackoverflow.com/questions/59023289/strange-error-in-hostresourceloader-when-run-ng-build-ng-build-prod-or-ng-se