Advertisement
Guest User

Untitled

a guest
Nov 27th, 2014
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. angular
  2.     .module('myApp.ctrl.list', [])
  3.     .controller('listCtrl', ['$scope', '$http', '$location', function ($scope, $http, $location) {
  4.  
  5.         $scope.people = [];
  6.         $scope.viewPerson = function (id) {
  7.             $location.path("/detail/" + id);
  8.         };
  9.  
  10.         $http({
  11.             method: 'GET',
  12.             url: '/api/people'
  13.         }).success(function (data, status, headers, config) {
  14.             $scope.people = data;
  15.         });
  16.  
  17.     }]);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement