$log.info( $routeParams.registrationId );
$scope.view = new View();
-if(1){//FIXME
+if(0){//FIXME
$scope.view.$get({ view: 'organizations' }, function(result) {
$log.info('View organizations', result);
angular.forEach( result.rows, function(value, key) {
}else{//FIXME
$scope.view.$key_array({ view: 'organizations' }, function(result) {
$log.info('key_array', result);
- $scope.organizations = result.rows;
+// $scope.organizations = result.rows; // FIXME doesn't refresh bs-typeahead
+ angular.forEach( result.rows, function(o) {
+ this.push( o );
+ }, $scope.organizations );
$log.info('organizations', $scope.organizations);
});
}
}).
factory('View', function($resource) {
return $resource('/:database/_design/registration/_view/:view?group=true;format=:format', { database: 'drzb2013' }, {
- key_array: {method:'GET', params:{ format:'key_array' }, isArray:true}
+ key_array: {method:'GET', params:{ format:'key_array' }, isArray:false}
});
});