I am looking for an angular-ified version of the request.js module -
https://www.npmjs.com/package/request
I have used it successfully from the Windows CLI in a small node.js app to
ignore CORS :-)
I cannot use $.ajax, $.post, $resource as they all insist on CORS.
I have been unsuccessful in incorporating it in an angularjs project. Is
there an angular-ified version of this module? Strangely, it appears that
request.js is included at least 5 times in the various angular modules I
use already, but I have no clue how to access it directly. Any help greatly
appreciated!
Also, the jshint linter dies on the request.js code. I could add in all the
missing ; and put commas on their preceding lines, but I don't know how to
rewrite lines like this:
var http = require('http')
, https = require('https')
, url = require('url')
, util = require('util')
, stream = require('stream')
, qs = require('qs')
, querystring = require('querystring')
, zlib = require('zlib')
, helpers = require('./lib/helpers')
, bl = require('bl')
, hawk = require('hawk')
...
as it seems require is a node function and is not available to angular.
Ideally I could include it like this:
angular.module('app.data.services', 'request', ['ngResource'])
.factory('restApi', ['$resource',
'$q',
'$ionicLoading',
'Request',
function($resource,
$q,
$ionicLoading,
Request
) {
...
Please point me in the right direction!
Regards,
Simon
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.