Java Reference
In-Depth Information
Next we will initialize the address of our seat resource in scripts/services/seat-
service.js :
'use strict';
angular.module('ticketApp').service('SeatService',
function SeatService($resource) {
return $resource('rest/seat/:seatId', {
seatId: '@id'
}, {
query: {
method: 'GET',
isArray: true
},
book: {
method: 'POST'
}
});
});
As you can see, we mapped our REST URL to the JavaScript code along with two HTTP
methods: GET and POST . They will be called by the controller to communicate with the
server; the same goes for our account resource, as shown in the following code:
'use strict';
angular.module('ticketApp').service('AccountService',
function AccountService($resource) {
return $resource( 'rest/account', {}, {
query: {
method: 'GET',
isArray: false
},
reset: {
method: 'POST'
}
});
});
Finally, we create a simple controller to place our logic at scripts/controllers/
seat.js :
Search WWH ::




Custom Search