});
} else {
$scope.registration = new Registration({ user: {} });
- $log.info("new Registration", $scope.user);
$scope.user = $scope.registration.user;
$scope.work = $scope.registration.work;
+ $log.info("new Registration", $scope.registration);
}
$log.info( $routeParams.registrationId );
$scope.$watch('user.registration_type', function( oldValue, newValue ) {
$log.info("registration_type watch", oldValue, newValue );
+ if ( oldValue === newValue ) return; // triggers on resource, so ignore it
+ if ( ! $scope.user ) { // resource triggers watch before loading json
+ $log.error("no user in scope");
+ return;
+ }
+
if (
$scope.user.registration_type == 'lecture' ||
$scope.user.registration_type == 'poster' ||