You need to sign in to do that
Don't have an account?

angularjs and heroku example
I am folloiwng the tutorial mentioned in the below URL.
https://developer.salesforce.com/mobile/getting-started/html5/#angularjs-heroku
I followed exactly as mentioned, I am able to OAuth successfully, I am able to create a contact and that gets saved, but during contact list view, I am getting the following error.
Error:
------------------------------------------------------------
Calling errorCB for forcetkClient:query
Refused to set unsafe header "User-Agent"
GET https://peaceful-gorge-3898.herokuapp.com/proxy/?_=1406084316812 400 (Bad Request)
function (){if(a){var n=a.length;(function s(t){x.each(t,function(t,n){var r=x.type(n);"function"===r?e.unique&&c.has(n)||a.push(n):n&&n.length&&"string"!==r&&s(n)})})(arguments),r?o=a.length:t&&(i=n,l(t))}return this}
------------------------------------------------------------------------
I am getting this error at this point.
function ContactListCtrl($scope, AngularForce, $location, Contact) {
if (!AngularForce.authenticated()) {
return $location.path('/home');
}
$scope.searchTerm = '';
$scope.working = false;
Contact.query(function (data) {
$scope.contacts = data.records;
$scope.$apply();//Required coz sfdc uses jquery.ajax
}, function (data) {
console.log(' ~~~~~~~~~~~~~ Error : ' + data.error);
alert('Query Error : ' + data.error);
$scope.contacts = data.records;
});
Did anybody encounter any such error?
https://developer.salesforce.com/mobile/getting-started/html5/#angularjs-heroku
I followed exactly as mentioned, I am able to OAuth successfully, I am able to create a contact and that gets saved, but during contact list view, I am getting the following error.
Error:
------------------------------------------------------------
Calling errorCB for forcetkClient:query
Refused to set unsafe header "User-Agent"
GET https://peaceful-gorge-3898.herokuapp.com/proxy/?_=1406084316812 400 (Bad Request)
function (){if(a){var n=a.length;(function s(t){x.each(t,function(t,n){var r=x.type(n);"function"===r?e.unique&&c.has(n)||a.push(n):n&&n.length&&"string"!==r&&s(n)})})(arguments),r?o=a.length:t&&(i=n,l(t))}return this}
------------------------------------------------------------------------
I am getting this error at this point.
function ContactListCtrl($scope, AngularForce, $location, Contact) {
if (!AngularForce.authenticated()) {
return $location.path('/home');
}
$scope.searchTerm = '';
$scope.working = false;
Contact.query(function (data) {
$scope.contacts = data.records;
$scope.$apply();//Required coz sfdc uses jquery.ajax
}, function (data) {
console.log(' ~~~~~~~~~~~~~ Error : ' + data.error);
alert('Query Error : ' + data.error);
$scope.contacts = data.records;
});
Did anybody encounter any such error?
this: GET https://peaceful-gorge-3898.herokuapp.com/proxy/?_=1406084316812 400 (Bad Request)
However, is. I suspect there's an issue with the way it's generating your url.
I am also having the same issue regarding the AngularJS code (https://www.sevenmentor.com/angularjs-training-in-pune.php) , so when i saw your code so i believe it's the matter of the URL creation. check this on your hand or tell us the next!!!!