Where to put model data and behaviour? [tl; dr; Use Services]

You should use services if you want something usable by multiple controllers. Here’s a simple contrived example: myApp.factory(‘ListService’, function() { var ListService = {}; var list = []; ListService.getItem = function(index) { return list[index]; } ListService.addItem = function(item) { list.push(item); } ListService.removeItem = function(item) { list.splice(list.indexOf(item), 1) } ListService.size = function() { return list.length; } … Read more