From 3c5502f06b04cea56ff810a078bfd7d3b2f09503 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C3=B9i=20L=C3=AA=20V=C5=A9=20T=C3=A2m?= Date: Mon, 18 Apr 2016 11:58:37 +0700 Subject: [PATCH] Update ngCart.js Change broadcast should be fire last --- src/ngCart.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ngCart.js b/src/ngCart.js index 7bc4047..3a3d315 100644 --- a/src/ngCart.js +++ b/src/ngCart.js @@ -150,9 +150,10 @@ angular.module('ngCart', ['ngCart.directives']) this.empty = function () { - $rootScope.$broadcast('ngCart:change', {}); this.$cart.items = []; $window.localStorage.removeItem('cart'); + $rootScope.$broadcast('ngCart:change', {}); + }; this.isEmpty = function () {