Controller does not run when I go back to the same state

Asked

Viewed 36 times

0

Hello, I have a problem in angular and Ionic 1 I have a restaurant market place app, similar to ifood, I have an order flow and as the steps go I record the order data in a place in the localStorage, at the end of the flow(shopping cart) I take this data from localStorage and show it to the user! The order flow in my app: I add a main product, I add an Optional, I add an Add-on.

You may or may not skip one of these parts, such as choosing an optional and going straight to the cart!

Explained my scenario, my problem is this: when I do not add an optional, when arriving in the cart the angular does not run the controller of the cart, and does not bind the new items that have in my localStorage.

I didn’t identify anything very different in optional controllers/add-ons and I’ve tried a few things like clear cache.

Complement and optional controller code: http://pastebin.com/7ZMh7rkj

Route code: http://pastebin.com/pWNbVGGv

In the cart template I just do an ng-repeat in the data coming from localStorage.

  • Please post the relevant code; No code to analyze makes it difficult to answer your question.

  • I added some related codes

  • Don’t post your code using external links; if this site goes off the air, your question won’t make sense. Instead, post the relevant source (only the relevant one) directly into the question

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.