src/select2.js
function(angular_data) {
          var model = [];
          if (!angular_data) {
            return model;
          }

          if (opts.simple_tags) {
            model = [];
            angular.forEach(
              angular_data,
              function(value, index) {
                model.push({'id': value, 'text': value});
              });
          } else {
            model = angular_data;
          }
          return model;
        }
function(angular_data) {
          var model = [];
          if (!angular_data) {
            return model;
          }

          if (opts.simple_tags) {
            model = [];
            angular.forEach(
              angular_data,
              function(value, index) {
                model.push({'id': value, 'text': value});
              });
          } else {
            model = angular_data;
          }
          return model;
        }
function ( angular_data ) { var model = [ ] ; if ( ! angular_data ) { return model ; } if ( opts . simple_tags ) { model = [ ] ; angular . forEach ( angular_data , function ( value , index ) { model . push ( { 'id' : value , 'text' : value } ) ; } ) ; } else { model = angular_data ; } return model ; }
/*
Convert from Angular view-model to Select2 view-model.
/ * Convert from Angular view - model to Select2 view - model .