title: How to get value in angularjs object attribute
body: <p>How can I get the value of field.jobtype in a controller?</p>
  <pre class="lang-js prettyprint-override"><code>var app=angular.module('myapp',['ui.bootstrap','ui.select']);
  app.controller('mycontroller',function($scope){
      $scope.onStateSelected = function (selectedItem) {
          $scope.selectedState=selectedItem.name;
      }
      $scope.oncarearchange=function(item){
          $scope.selectedLocation=item.name;
      }
      var state=[{&quot;name&quot;:&quot;entry&quot;},{&quot;name&quot;:&quot;intermediate&quot;},{&quot;name&quot;:&quot;senier&quot;},{&quot;name&quot;:&quot;teamlead&quot;}];
      var carearlevel=[{&quot;name&quot;:&quot;entry&quot;},{&quot;name&quot;:&quot;intermediate&quot;},{&quot;name&quot;:&quot;senier&quot;}{&quot;name&quot;:&quot;teamlead&quot;}];
      $scope.states=state;
      $scope.carear=carearlevel;
  });
  </code></pre>
  <pre class="lang-html prettyprint-override"><code>&lt;ui-select ng-model=&quot;field.jobtype&quot;  theme=&quot;select2&quot;  ng-disabled=&quot;disabled&quot; class=&quot;form-control input-md c-square&quot; on-select=&quot;onStateSelected($item)&quot;&gt;
    &lt;ui-select-match placeholder=&quot;Select a jobtype...&quot;&gt;
      {{$select.selected.name}}
    &lt;/ui-select-match&gt;
    &lt;ui-select-choices repeat=&quot;state.name as state in states | filter: $select.search&quot;&gt;
    {{state.name}}
    &lt;/ui-select-choices&gt;
  &lt;/ui-select&gt;
  </code></pre>
  <p>Here the ui-select display values from the array sate which is assigned to $scope.states,but when try to display field, jobtype in controller it shows the error jobtype is not defined.</p>