title: Update / add values to multiple select2 field after ajax call
body: <p>I try to add values to a select2 (multiple select) field after performing an ajax call.
  I search for the solution and find this question:
  <a href="https://stackoverflow.com/questions/25428361/dynamically-add-item-to-jquery-select2-control-that-uses-ajax">Dynamically add item to jQuery Select2 control that uses AJAX</a></p>
  
  <p>This is my JS:</p>
  
  <pre><code>$scope.addProjectType = function(name) {
          $http.post('/ajax/projecttype/addprojecttype', {
              name: name
          }).success(function(data, status, headers, config) {
              $("#projectTypes").select2('data', {
                  id: 1, name: 'test'
              })
          });
      }
  </code></pre>
  
  <p>It's all fine, but while performing the ajax success function this gives me the error </p>
  
  <blockquote>
    <p>Error: state_id.split is not a function
    format@<a href="http://ttos2.localhost/vendor/assets/global/js/plugins.js:269:31" rel="nofollow noreferrer">http://ttos2.localhost/vendor/assets/global/js/plugins.js:269:31</a>
    i&lt;.addSelectedChoice@<a href="http://ttos2.localhost/vendor/assets/global/plugins/select2/select2.min.js:6:54786" rel="nofollow noreferrer">http://ttos2.localhost/vendor/assets/global/plugins/select2/select2.min.js:6:54786</a>
    i&lt;.updateSelection/&lt;@<a href="http://ttos2.localhost/vendor/assets/global/plugins/select2/select2.min.js:6:53377" rel="nofollow noreferrer">http://ttos2.localhost/vendor/assets/global/plugins/select2/select2.min.js:6:53377</a></p>
  </blockquote>
  
  <p>What I am doing wrong here?</p>