i have a project am working about a shopping list and am making in such a way that the user types the item he wants to add and whenever he adds it displays that he has dded a particular product and not to forget he has the ability to remove any product from the list. But when never i reload the page it displays empty even though i already added some item previously..this is the code
var app = angular.module("shoppingList",[]);
app.controller("myCtrl",function($scope){
$scope.goods = []
var taskData = localStorage()
$scope.addItem = function(){
$scope.errorText = "";
if(!$scope.addNew){return;}
if($scope.goods.indexOf($scope.addNew) == -1){
$scope.goods.push($scope.addNew);
}else{
$scope.errorText = "The Item is already in your shopping list"
}
};
$scope.removeItem = function(x){
$scope.errorText = ""
$scope.goods.splice(x,1);
}
})