Imagine we have an Angular 2 application. There is a service method that returns data using post(), with a catch() statement to handle any errors.
In the component, we are subscribing to the Observable's data:
.subscribe(
()=> {
// some code
}
)
If we need to retrieve data from localStorage or perform another critical operation, can we use a try/catch statement inside this method? Or is there a different correct approach?