I read an example that load service at Angularjs application. Would you provide example more detail than load service to applicaiton from example? If application put message send to Thrift-server as service define such
struct RoomRate{
1: required i32 room; // 1
2: required i32 price; // 2
}
service RoomRateService {
void calculateRoomService(1:RoomRate roomRate);
}
My view i can send data to Thrift-server follow as example below. Parameter roomRate
is struct of Thirft-DL send to Thirft-server that provides service and send response back to print in console console.log('response from server:', response);
angular.module('my-module').service('RoomService', ['ThriftRoomService', function
(ThriftRoomService) {
ThriftRoomService.calculateRoomService().then(function (response, roomRate) {
console.log('response from server:', response);
}, function (reason) {
console.log('thrift rpc call failed:', reason);
});
}]);