export class Component{
constructor(){}
if (
this.categoryId != undefined &&
(this.serviceId == undefined || this.serviceId == 0)
) {
if (this.locationName == undefined) {
alert("call by category id API");
this.postService.searchListingById(this.categoryId).subscribe(res => {
console.log(res);
this.rawdata = res.json();
console.log(this.rawdata);
});
this.router.navigate(["/web/search"]);
} else {
alert("Call by Category Location Api");
}
}
}
I have a value stored in this.rawdata and i want to pass that value to another component how to achieve it using angular 4
and i have rawdata value like this
(6) [{…}, {…}, {…}, {…}, {…}, {…}]
0: {id: 16, installerTitle: "Test71", firstName: "Test71", middleName:
"Test71", lastName: "Test71", …}
1: {id: 3, installerTitle: "Test19", firstName: "Test19", middleName:
"Test19", lastName: "Test19", …}
2: {id: 3, installerTitle: "Test19", firstName: "Test19", middleName:
"Test19", lastName: "Test19", …}
3: {id: 57, installerTitle: "Listing Title", firstName: "Pankaj",
middleName: "Kumar", lastName: "Sharma", …}
4: {id: 58, installerTitle: "Test128", firstName: "Test128", middleName:
"Test128", lastName: "Test128", …}
5: {id: 58, installerTitle: "Test128", firstName: "Test128", middleName:
"Test128", lastName: "Test128", …}