0

I am making a online market app. There are i have shopping cart functionality but i do not know how i can realize it in ionic/angularjs. How i can do this or or is there a ready solution? enter image description here

enter image description here

The problem is i have controllers for each page. But i need update badge value in each page.How i can update badge value when i clicking add to cart button in product controller?

beka.angsabay
  • 413
  • 1
  • 6
  • 15
  • What does the documentation of ionic say? Do you have any code you've been trying to work on so far? – Ulf Gjerdingen Jun 21 '16 at 11:53
  • I don't know of any ready-made solutions, but in order to "watch" events on another scope, you should look at http://stackoverflow.com/questions/19446755/on-and-broadcast-in-angular and https://docs.angularjs.org/api/ng/type/$rootScope.Scope#$on – Matt M Jun 21 '16 at 12:07

1 Answers1

1
  • you can fire an event in the controller, and catch it where the badge is.
  • you can use the $rootScope service and save there the badge status
  • you can implement your own service and save there the badge status
Kobi Cohen
  • 678
  • 4
  • 9