-
-
Save ccit-spence/9715311 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -i -H "Accept: application/json" localhost:8080/rest-app2/users | |
HTTP/1.1 200 OK | |
Server: Apache-Coyote/1.1 | |
Content-Type: application/json;charset=UTF-8 | |
Transfer-Encoding: chunked | |
Date: Sat, 22 Mar 2014 21:55:29 GMT | |
[{"class":"rest.app2.User","id":1,"firstName":"Jane","lastName":"Doe"},{"class":"rest.app2.User","id":2,"firstName":"John","lastName":"Doe"},{"class":"rest.app2.User","id":3,"firstName":"Daffy","lastName":"Duck"}] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
angular.module('quick-demo', ['ui.bootstrap','ui.utils','ngRoute','ngAnimate']); | |
angular.module('quick-demo') | |
.config(function($routeProvider) { | |
'use strict'; | |
$routeProvider. | |
when('/',{ | |
templateUrl: 'views/index/index.tpl.html', | |
controller: 'indexController' | |
}). | |
when('/ili',{ | |
templateUrl: 'views/ili/ili.tpl.html', | |
controller: 'iliController' | |
}). | |
/* Add New Routes Above */ | |
otherwise({redirectTo:'/'}); | |
}); | |
angular.module('quick-demo').config(['$httpProvider', function($httpProvider) { | |
'use strict'; | |
$httpProvider.defaults.useXDomain = true; | |
delete $httpProvider.defaults.headers.common['X-Requested-With']; | |
}]); | |
angular.module('quick-demo').run(function($rootScope) { | |
'use strict'; | |
$rootScope.safeApply = function(fn) { | |
var phase = $rootScope.$$phase; | |
if (phase === '$apply' || phase === '$digest') { | |
if (fn && (typeof(fn) === 'function')) { | |
fn(); | |
} | |
} else { | |
this.$apply(fn); | |
} | |
}; | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function () { | |
'use strict'; | |
angular.module('quick-demo').controller('iliController',function($scope, $http){ | |
$http({ | |
method: 'GET', | |
url: 'http://localhost:8080/rest-app2/users', | |
headers: { | |
'Accept': 'application/json' | |
} | |
}).success(function (data) { | |
$scope.data = data; | |
}).error(function(error){ | |
$scope.error = error; | |
}); | |
}); | |
}()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="col-md-12"> | |
<h1>ili view</h1> | |
<p>This is the base template for your new view.</p> | |
<div ng-repeat="user in data"> | |
<p>{{user.firstName}} {{user.lastName}}</p> | |
</div> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment