title: How to parse an Object
body: <p>I have a Job object that contains JobTypeId, JobClassId,GeoAreaId. I can successfully send back one id to the apiController but when i try to parse all 3 of them I get a error:</p>
  
  <blockquote>
    <p>Unexpected token o at Object.parse (native)</p>
  </blockquote>
  
  <p>Angular Controller</p>
  
  <pre><code> $scope.updateJob = function (job) {
      console.log($scope.currentItem);
      var jt = JSON.parse($scope.currentItem.JobType)
      var jc = JSON.parse($scope.currentItem.JobClass)
      var ga = JSON.parse($scope.currentItem.GeoArea)
      job.JobTypeId = jt.JobTypeId;
      job.JobClassId = jc.JobClassId;
      job.GeoAreaId = ga.GeoAreaId;
      jobFactory.updateJob(job).success(successCallback)
          .error(errorCallback);
      console.log(job); 
  };
  var successCallback = function (data, status, headers, config) {
      notificationFactory.success();
  };
  var errorCallback = function (job, status, headers, config) {
      notificationFactory.error(job.ExceptionMessage);
  };
  </code></pre>
  
  <p>View</p>
  
  <pre><code> &lt;select ng-controller="JobMiscCtrl" style="width:148px" ng-model="currentItem.JobType"&gt;
     &lt;option ng-repeat="job in jobTypeArray" title="{{job.JobTypeName}}" ng-selected=" {{job.JobTypeId == currentItem.JobTypeId}}" value="{{job}}"&gt;
       {{job.JobTypeName}}
     &lt;/option&gt;
   &lt;/select&gt;
   &lt;select ng-controller="JobMiscCtrl" style="width:148px" ng-model="currentItem.JobClass"&gt;
      &lt;option ng-repeat="job in jobClassArray" title="{{job.JobClassName}}" ng-selected="{{job.JobClassId == currentItem.JobClassId}}" value="{{job}}"&gt;
      {{job.JobClassName}}
      &lt;/option&gt;
   &lt;/select&gt;
   &lt;select ng-controller="JobMiscCtrl" style="width:148px" ng-model="currentItem.GeoArea"&gt;
     &lt;option ng-repeat="job in geoAreaArray" title="{{job.GeoAreaName}}" ng-selected="{{job.GeoAreaId == currentItem.GeoAreaId}}" value="{{job}}"&gt;
         {{job.GeoAreaName}}
     &lt;/option&gt;
   &lt;/select&gt;
  
   &lt;input ng-controller="JobCtrl" style="margin-right: 20px; width: 70px; margin-top: 25px" type="submit" ng-click="updateJob(currentItem)" value="Submit" /&gt;
  </code></pre>
  
  <p>Updated
  I moved everything into 1 controller. The view is returning a string. the apiController is expecting the JobTypeId only. So that is why I am trying to parse the Id properties from the string. this is what i am looking at</p>
  
  <pre><code>{{currentItem.GeoArea.GeoAreaId}}
     &lt;label style="margin-left:57px"&gt;Geo&amp;nbsp;Area:&lt;/label&gt;
     &lt;select style="width:148px" ng-model="currentItem.GeoArea.GeoAreaId"&gt;
      &lt;option ng-repeat="job in geoAreaArray" title="{{job.GeoAreaName}}" ng-selected="{{job.GeoAreaId == currentItem.GeoAreaId}}" value="{{job}}"&gt;
       {{job.GeoAreaName}}
      &lt;/option&gt;
     &lt;/select&gt;
  </code></pre>
  
  <p>when I select a new GeoArea, you see what shows up in the currentItem.GeoArea.GeoAreaId
  <img src="https://i.stack.imgur.com/J07jI.jpg" alt="pic"></p>