angular
  .module('app')
  .controller('ArtworkEditController', ArtworkEditController)

  function ArtworkEditController(artwork, $scope, movements, Artwork) {
    var vm = this;
    vm.data = artwork.data["artwork"];
    vm.movements = movements.data.movements;
    vm.selection = [];

    vm.movementChecked =  movementChecked;
    vm.toggleSelection = toggleSelection;
    vm.submitArtwork = submitArtwork;

    vm.data.movements.forEach(function(movement) {
      vm.selection.push(movement.id);
    });

    function movementChecked(id) {
      var value;

      vm.data.movements.forEach(function(movement) {
        if(id === movement.id) {value = movement.id}
      })
      return value
    }

    function toggleSelection(movementId) {
      var id = vm.selection.indexOf(movementId)
      if(id > -1){
        vm.selection.splice(id, 1)
      } else {
        vm.selection.push(movementId)
      }
    }

    function submitArtwork(artwork) {
      artwork.movements = vm.selection
      Artwork.updateArtwork(artwork)
    }

  }

@@ -211,16 +211,55 @@
 work%22%5D;%0A
+    vm.artists = artists.data.artists;%0A
     vm.m

define artists in ArtworkEditController