Answer the question
In order to leave comments, you need to log in
What is the correct way to create a global object in an Angular application?
Good afternoon!
In application I get an array of type $scope.myObject = [];
Adding objects to this array occurs, let's say, from one page, deleting - from another. How to make it so that at any time from any page this array is up-to-date? Each time I add and remove data, I send it to the server, that is, each time I get a new instance of the array from there. But apparently I got confused in scopes, because on different pages I have a different array in the console. Tell me how to implement correctly? In fact, it's like adding/removing items to the shopping cart in an online store.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question