config(['$routeProvider', function($routeProvider) {
$routeProvider.when('/registration', {templateUrl: 'partials/registration.html', controller: RegistrationCtrl});
$routeProvider.when('/registration/:registrationId', {templateUrl: 'partials/registration.html', controller: RegistrationCtrl});
+ $routeProvider.when('/registration-finished/:registrationId', {templateUrl: 'partials/registration-finished.html', controller: RegistrationCtrl});
$routeProvider.when('/view2', {templateUrl: 'partials/partial2.html', controller: MyCtrl2});
$routeProvider.otherwise({redirectTo: '/registration'});
}]);
/* Controllers */
-function RegistrationCtrl($scope, $log, Registration, $routeParams) {
+function RegistrationCtrl($scope, $log, Registration, $routeParams, $location, $route) {
$scope.$routeParams = $routeParams;
+ $scope.$location = $location;
$scope.update = function(user) {
- $log.info("saved", user, user.$save());
+ user.$save();
+ $log.info("saved", user);
+ $location.path( '/registration-finished/' + $routeParams.registrationId );
}
$scope.reset = function() {
--- /dev/null
+
+<div ng-controller="RegistrationCtrl" name="RegistrationForm">
+
+Registration for
+
+{{user.firstname}}
+{{user.surname}}
+{{user.organization}}
+{{user.email}}
+
+
+Received, thanks.
+
+<pre>
+user={{user}}
+
+$routeParams={{$routeParams}}
+
+{{RegistrationForm.$valid}}
+{{RegistrationForm.$error}}
+
+location={{$location}}
+
+</pre>
+
+</div>
+
+