-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Content Type parsing error #46
Comments
Could you |
Wow, fast answer, was expecting to wait for hours :-) Controller code: $rootScope.apiRoot = $http({url: 'http://localhost:8080/api-1.0/'});
$rootScope.$watch('apiRoot', function(apiRoot){
if (apiRoot != undefined) {
$rootScope.dashboards = apiRoot.$request().$get('foo');
}
});
|
Which version are you on? |
I edited my last post with the ctrl code. |
Ah, I see the error in my README. Try this: $http({url: 'http://localhost:8080/api-1.0/'})
.then(function(apiRoot) {
$rootScope.apiRoot = apiRoot;
});
$rootScope.$watch('apiRoot', function(apiRoot){
if (apiRoot != undefined) {
$rootScope.dashboards = apiRoot.$request().$get('foo');
}
}); |
Yeah, I spotted that too, and tried to assign in then, without really real success :( Still getting: |
What |
|
Looks like $http has been kept untouched. I mean, I guess angular-hal is extending default $http, right ? :-) |
I think I've implemented this line wrong: |
Well spotted ! if (response.headers('Content-Type').indexOf(CONTENT_TYPE) > -1) { ... } EDIT: Doing so make it works on my side at least :p |
I think it would be good to integrate a library like this one: |
Not a bad idea indeed, since it's a pretty lightweight library. |
Would you be interested to make a pull request for that? |
You mean, to add the library and refactor angular-hal to work with it ? |
Yes, exactly. And maybe also write a test for it. |
Ok why not, you have to know that it will be my first time contributing, but I'm really glad to ! :-) |
So, I've created a simple module + factory, but actually I'm just wondering 3 things:
I quite simply "duplicated" url-generator module & factory to create that, so, no-brain. I wouldn't be surprised if you tell me it's total bull**** :p As I said, first time contributing, not used to all this stuff, and I'm really happy to be able to learn & contribute :) |
I simply tried using the sample code on the readme (replacing urls of course), but I just get the following error:
apiRoot.$request is not a function
Any help would be appreciated. :-/
The text was updated successfully, but these errors were encountered: