ERROR Error: Uncaught (in promise): Error: StaticInjectorError(AppModule)[HomePage -> DataProvider]:
StaticInjectorError(Platform: core)[HomePage -> DataProvider]: NullInjectorError: No provider for DataProvider! Error: StaticInjectorError(AppModule)[HomePage -> DataProvider]:
StaticInjectorError(Platform: core)[HomePage -> DataProvider]: NullInjectorError: No provider for DataProvider!
I have no idea how to solve it.
home.ts
…
constructor(public navCtrl: NavController, public http: HttpClient, public dataProvide: DataProvider, public transformProvider: TransformProvider) {
this.x2j();
}
x2j(){
this
.dataProvide
.getRandomUser()
.pipe(
map((res: string) => this.transformProvider.convertToJson(res))
)
.subscribe((res: Object) => {
console.dir(res);
});
}
if you have another way to convert xml->Json tell me
You have to pass parameter to the next page and you have to show. Let’s take 2 pages for example, ListPage and DetailsPage let’s say.
First, in list.html
<ion-card *ngFor="let review of reviews; let i=index;" [hidden]="i>4" (click)="detailsFunc(review)">
<!--here we are passing that single object to the function as parameter-->
<ion-card-title>
{{review.Title}}
</ion-card-title>
<ion-card-content>
<h5>{{review.Content}}
</ion-card-content>
</ion-card>
Now i m trying to link several Json link on one page and diplay for each Json the specific content.
For example:
home.ts
getAmericaData(){
let data: Observable<any> = this.http.get(the link url json from America Music review);
data.subscribe(data =>{
this.reviews = data["Collections"].Review;
});
}
getFranceData(){
let data: Observable<any> = this.http.get(the link url json from France Music review);
data.subscribe(data =>{
this.reviews = data["Collections"].Review;
});
}
Anchor link is not working from JSON string in ionic 3 and angular 4 : ur <a (click)=‘openActionPage()’>terms and conditions
Am using this string in JSON file.
In order to proceed, you need to agree with our “terms and conditions” and adding for accessing in frontend using
<message *ngFor="let message of messages" [innerHTML]="message.content"> {{message.content}}</message>
but the link openActionPage() is not opening in front end.
( “my.item1”: " Hi, In order to proceed, you need to agree with our <a (click)='openActionPage()>terms & conditions)
using this (my.item1) key am accessing it in frontend from Mongo translations, please help me to proceed it