I have something like this -
function DetailCtrl($scope) { $scope.persons = [{ id: 1, name: "Mark" }]; }
I would like to leave the models separate from the controller, for example:
//models var person = { id: '', name: '' }; function DetailCtrl($scope) { person = db.getPerson(); $scope.person = person; }
Is this good practice in angularjs? I came from ASP.NET MVC background.
source share