Hello,
i have this provider to load data from a url
export class FortniteProvider {
url: string ="https:/example/v1/profile/";
key: string = "Key: b4776120-e427-4e22-b16d-77090958e957";
constructor(private http: HttpClient) {
console.log('Hello FortniteProvider Provider');
}
getUserData(username: string, platform: string){
console.log("getUserData loaded //com by me");
return this.http.get(`${this.url}${platform}/${username}`, {headers: {API_KEY}});
}
this is the error:
there are my “app.module.ts”
import { BrowserModule } from '@angular/platform-browser';
import { ErrorHandler, NgModule } from '@angular/core';
import { IonicApp, IonicErrorHandler, IonicModule } from 'ionic-angular';
import { SplashScreen } from '@ionic-native/splash-screen';
import { StatusBar } from '@ionic-native/status-bar';
import { MyApp } from './app.component';
import { FortniteProvider } from '../providers/fortnite/fortnite';
import { HttpClientModule } from '@angular/common/http';
@NgModule({
declarations: [
MyApp,
],
imports: [
BrowserModule,
HttpClientModule,
IonicModule.forRoot(MyApp)
],
bootstrap: [IonicApp],
entryComponents: [
MyApp,
],
providers: [
StatusBar,
SplashScreen,
{provide: ErrorHandler, useClass: IonicErrorHandler},
FortniteProvider
]
})
export class AppModule {}
and my ionic.config.json
{
"name": "FortniteStats",
"type": "ionic-angular",
"integrations": {
"cordova": {}
}
}
why isn’t it working?