I updated the application from Angular from 4.2 to 5, but received this error:,
unhandled exception occurred while processing the request
or rather:
NodeInvocationException: no provider for PlatformRef! Error: no provider for PlatformRef! upon injection Error (E: \ MyApp \ ClientApp \ distance \ vendor.js: 12066: 90)
The application also uses webpack and ASP.NET Core
.
I installed node v9.1
and typescript 2.6.1
.
I also updated package.json
using the command:
npm install @angular/common@latest @angular/compiler@latest @angular/compiler-cli@latest @angular/core@latest @angular/forms@latest @angular/http@latest @angular/platform-browser@latest @angular/platform-browser-dynamic@latest @angular/platform-server@latest @angular/router@latest @angular/animations@latest typescript@latest
And after that they launched the following:
npm install --save-dev @ngtools/webpack@latest
I also used HttpClient
instead Http
:
import { HttpClient } from '@angular/common/http';
.....
getThings() {
return this.http.get('/api/things');
}
If I go back to Angular 4, the application is working fine, is there something in my thought that was done wrong?