i recently bought an HTML template using AngularJS. This is a shop where you can add items on your cart, and i'd like to be able to make a function that empty the cart. When i run this command in console :
angular.element($0).scope()
I can get all my current variables. And i can see what is in the array cart :
I created a basic JS function where it runs this :
$scope.cart = [];
This should empty the cart as this initialize the array as empty. I also tried others things found on stack but nothing works. But when i run the function, i refresh the page and my cart is still containing objects, while the angular.element($0).scope() command returns nothing. What am i forgetting ? Thank you in advance for your help :)
EDIT :
function myfct(){
$scope.cart = [];
}