Using Nativescript 5.0 + Angular
Unable to figure out how can I accomplish it?
From first view (referred in this post as original view), user taps a button
this.router.navigate(["secure/booking/city"]) displays new view having listview
User taps the city item he want to select from the view
this.router.back() is called onItemTap
User can see the original screen
I want city item details (name & ID) back to the original view.
I have tried using ApplicationSettings from second view and read back in original view, but not happening.
Below is the code snip
this.router.navigate(["secure/booking/city"]).then((response) => {
console.log("ret data name : " + ApplicationSettings.getString("cityname"));
ApplicationSettings.setString("cityname","");
}, (e) => {
console.log("error -ret data name : " + ApplicationSettings.getString("cityname"));
});
You could simply use a Service with BehaviorSubject, subscribe to it in the original view and update the BehaviorSubject as needed.