[keycloak-dev] any ideas on this angular problem?

Bill Burke bburke at redhat.com
Wed Aug 7 19:55:11 EDT 2013


I couldn't get the simple select box [1] example working as-is within 
the admin gui.  I had to do this:

     $scope.selection = {
         colors : [
             {name:'black', shade:'dark'},
             {name:'white', shade:'light'},
             {name:'red', shade:'dark'},
             {name:'blue', shade:'dark'},
             {name:'yellow', shade:'light'}
         ],
         color : null
     };

     $scope.changeApplication = function() {
         console.log('ApplicationListCtrl.changeApplication() - ' + 
$scope.selection.color.name);
     };


and this:

<select ng-change="changeApplication()" ng-model="color" 
ng-options="c.name for c in colors">

If I implemented it the same way as the example, "color" would always 
remain 'red'.  Any ideas?  Maybe I'm losing my mind...

[1] http://code.angularjs.org/1.0.7/docs/api/ng.directive:select



-- 
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com


More information about the keycloak-dev mailing list