Issue
i have a Singleton service class in Angular :
Solution
export class TripDetailsPage implements OnInit {
currentTrip:Trip = new Trip("","")
constructor(private router:Router, private tripService:TripService) { }
ngOnInit() {
this.currentTrip = this.tripService.getCurrentTrip();
console.log(this.currentTrip);
}
switchToTab(path: string) {
this.router.navigate(['home/trips/trip-details/' + path]);
}
}
Answered By - StPaulis
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.