[ https://issues.apache.org/jira/browse/THRIFT-2820?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14385806#comment-14385806 ]
Paul Smith commented on THRIFT-2820: ------------------------------------ I used the existing jqRequest "way" to create a ngRequest inside the Thrift.Transport mechanism. Look at the code at the beginning of https://github.com/uvwxy/thrift/blob/dev-uvwxy/lib/js/test/test-angular.js to see how to create a AngularJS controller that injects $http and provides this to the Thrift.Transport layer. The tests all pass (but fall back to jqRequest for the test.js assertions to provide a working system as $http is not injected here). Someone should help me figure out what the 'best' way to proceed should be here. At the moment I believe it works, although I think, that the Exceptions are not provided correctly (TODO). This should work as a proof of concept. > Implement an alternative Transport for JS using the AngularJS $http-service > --------------------------------------------------------------------------- > > Key: THRIFT-2820 > URL: https://issues.apache.org/jira/browse/THRIFT-2820 > Project: Thrift > Issue Type: New Feature > Components: JavaScript - Library > Affects Versions: 0.9.2 > Environment: AngularJS, Browser > Reporter: David Sautter > Priority: Minor > Labels: features > Original Estimate: 168h > Remaining Estimate: 168h > > Since the architecture of the Thrift-library for Javascript-clients allows us > to use custom Transports, I would like to have a Transport using the > AngularJS $http-service. This would allow us to mock a Thrift Server in Tests > as well as intercepting and customizing Thrift requests (e.g. authentication). > The Tansport can be included into your AngularJS App via a module so that you > can use it to instantiate your clients. -- This message was sent by Atlassian JIRA (v6.3.4#6332)