angular newbie here.
Let\'s say I have an application that needs to monitor different things like \"news submitted\" \"login attemps\" and so on. My mainController w
You can create a service, that will be storing the data between the controllers. Then you can use / change that piece of data in both of your controllers and associated views.
app.service('newsDataService', function() {
this.newsData = [];
});
then in your controller,
app.controller('newsController', function($scope, 'newsDataService') {
// access the data using newsDataService.newsData.
});
app.controller('loginAttemptsController', function($scope, 'newsDataService') {
// access the data using newsDataService.newsData.
});
More information on AngularJs Services : https://docs.angularjs.org/guide/services