'use strict';

angular.module('confRegistrationWebApp')
  .directive('block', function () {
    return {
      templateUrl: 'views/blockDirective.html',
      restrict: 'E',
      scope: {
        'block': '=',
        'prefillAnswer': '=answer'
      },
      controller: function ($scope) {
        $scope.answer = {};

        $scope.updateAnswer = function () {
//          $scope.answer.$save();
          console.log('update answer in ' + $scope.block.id + ' to ' + angular.toJson($scope.answer));
        }
      }
    };
  });

@@ -309,16 +309,54 @@
 answer =
+ angular.copy($scope.prefillAnswer) %7C%7C
  %7B%7D;%0A%0A  

Load answers from directive parameters