SHARE
TWEET

Untitled

a guest Dec 15th, 2014 5 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ERROR (Console)
  2. First Time I Switch The Select Box, I get my object...
  3. Object {id: 1, creator_id: 1, name: "Dare, Auer and Grady", address: "0324 Spencer Harbors Suite 873", city: "Bartonfort"…}
  4. Next Time I switch the selectbox, I get...
  5. TypeError: object is not a function
  6.  
  7. //HTML
  8. <select ng-options="selectedOffice as selectedOffice.id for selectedOffice in offices track by selectedOffice.id | orderBy: 'id'" ng-model="selectedOffice" ng-change="editOffice()"></select>
  9.  
  10. // JS
  11.         $scope.editOffice = function()
  12.         {
  13.                 console.log($scope.selectedOffice);
  14.                 $scope.editOffice = angular.copy($scope.selectedOffice);
  15.         }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top