You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I would need to access ngCart.getTotalItems() and ngCart.totalCost() functions from my controller's view (in order to display some items conditionally based on the number of items added to the cart and the total cost of it). What would be the way to correctly accessing those functions? Should I create a service/factory for it?
Thanks in advance
The text was updated successfully, but these errors were encountered:
Hi, thanks for your reply. I have also used those functions when I'm inside the ng directive (for example, in the cart.html or checkout html files). The point is that I would like to use it also from outside the directive (that is, from my controller's view, but outside the parts injected by <ng-cart></ng-cart> or <ng-checkout></ng-checkout>
Did you manage to do that with the ngCart object? I don't seem to be able to access the object outside the directive, but maybe I'm doing something wrong...
Hi, I would need to access
ngCart.getTotalItems()
andngCart.totalCost()
functions from my controller's view (in order to display some items conditionally based on the number of items added to the cart and the total cost of it). What would be the way to correctly accessing those functions? Should I create a service/factory for it?Thanks in advance
The text was updated successfully, but these errors were encountered: