load old registration if it exists
[angular-drzb] / app / js / controllers.js
1 'use strict';
2
3 /* Controllers */
4
5
6 function RegistrationCtrl($scope, $log, Registration, $routeParams) {
7
8         $scope.$routeParams = $routeParams;
9
10         $scope.update = function(user) {
11                 $log.info("saved", user, user.$save());
12         }
13
14         $scope.reset = function() {
15                 if ( $routeParams.registrationId ) {
16                         $scope.user = new Registration();
17                         $scope.user.$get({ registrationId: $routeParams.registrationId });
18                         $log.info("get Registration", $scope.user);
19                 } else {
20                         $scope.user = new Registration();
21                         $log.info("new Registration", $scope.user);
22                 }
23                 
24                 $log.info( $routeParams.registrationId );
25         }
26
27         $scope.reset();
28 }
29 //RegistrationCtrl.$inject = [ '$scope', '$log' ];
30
31
32 function MyCtrl2() {
33 }
34 MyCtrl2.$inject = [];