I am using angular 4 with mySql Db.
Here is my service.
service.ts
getData(){
return this.http.get('http://example/users.php').map(res=>{
return res.json();
}).catch(err=>{
return err.json();
})
}
i have two pages One is Home,another one is About.
Here is my Home Component.
ngOnInit() {
this.API.getData().subscribe(res=>{
console.log("dashoard",res);
})
}
Here is my result.
like this JSON.
[{
"user":"name one",
"status":"1"
},
{
"user":"name two",
"status":"1"
}]
I fetch records based on user status is 1.
i changed any values is database.
I changed name one user status is "0";
go to About page then click to home Page.
record length is 2.When i click ctrl+f5 record length is 1.
My problem is data retrieved.But does not get updated data.why?
I have no idea.
Kindly advice me,
Thanks.