maddoge23 maddoge23 - 4 months ago 40
AngularJS Question

Ionic Cordova Badge Cart Number

I'm working on a shopping cart using

cordova
and
ionic
and I have some questions:

How can I get total item cart to badge in ionic?

I've try with the following
code
:

Ionic badge:

ng-model="data.badgeCount"


Controller:

$scope.data = {
badgeCount : 2
}


and it works well, but when I change it to:

ng-model="{{total_qty}}"


it gives me an error. Can anybody help me ?

Answer

Well, your question is unclear, but ngModel directive works without interpolation:

ng-model="total_qty"