http://jsfiddle.net/maxl/tNZAm/102/
I would expect to have the repeater listing this array :
function MyControl(){
var self = this;self.values = ["a","b","c","d","e","f"]; self.selectedIndex = -1; self.toggleSelect = function(ind){ if( ind === self.selectedIndex ){ self.selectedIndex = -1; } else{ self.selectedIndex = ind; } } self.getClass = function(ind){ if( ind === self.selectedIndex ){ return "selected"; } else{ return ""; } } self.getButtonLabel = function(ind){ if( ind === self.selectedIndex ){ return "Deselect"; } else{ return "Select"; } } }
You should be using the
$scopeinjectable to attach data to the DOM. Additionally, you were loading Angular.js twice (once via the “Choose Framework” dropdown and once via the “Add Resources” panel), resulting in a very, very strange bug.Here’s a working jsFiddle: http://jsfiddle.net/BinaryMuse/tNZAm/103/