function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
kavayahkavayah 

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?
KevinPKevinP
so this: Refused to set unsafe header "User-Agent" isn't a fatal 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. 
RobAlexanderRobAlexander
I am getting a similar 400 (Bad Request) error. @KevinP, can you elaborate on your suspicion about the way it's generating the URL?
surbhi nahtasurbhi nahta
Hi,
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!!!!