Issue
I'm learning Angular and I have a request object that is of this form:
var data = {
destinationProjectId: proj.Id,
items: $scope.selections // this is an array
}
$scope.selections gives me back the actual JavaScript object back. The endpoint expects the items array to have the Id of the selections only. I know I could just do something like:
var newItems = [];
$scope.selections.forEach((obj) => {
newItems.push(parseInt(obj.Id));
});
and send that with $http. But what I'm trying to do is:
$http({ method: "POST", url: url, data: $scope.selections,
transformRequest: (data, headers) => {
var payload = [];
var s = <any>data.items;
s.forEach((o) => {
payload.push(parseInt(o.Id));
});
return payload;
});
In the firebug console, I get:
[Exception... "JavaScript component does not have a method named: "available"'JavaScript component does not have a method named: "available"' when calling method: [nsIInputStream::available]" nsresult: "0x80570030 (NS_ERROR_XPC_JSOBJECT_HAS_NO_FUNCTION_NAMED)"
What might be going on?
Solution
[Exception... "JavaScript component does not have a method named: "available"'JavaScript component does not have a method named: "available"' when calling method: [nsIInputStream::available]" nsresult: "0x80570030 (NS_ERROR_XPC_JSOBJECT_HAS_NO_FUNCTION_NAMED)"
This is an error in some firefox plugin. Not your code. nsIInputStream
is an API by firefox for plugins. (ref: https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIInputStream)
Perhaps update your firebug or check other plugins.
Answered By - basarat
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.