text: angular.module("<%= appName %>").controller("RegisterCtrl", ['$meteor', '$state',
    function ($meteor, $state) {
      var vm = this;
  
      vm.credentials = {
        username: '',
        password: '',
        email: ''
      };
  
      vm.error = '';
  
      vm.register = function () {
        $meteor.createUser(vm.credentials).then(
          function () {
            $state.go('home');
          },
          function (err) {
            vm.error = 'Registration error - ' + err;
          }
        );
      };
    }
  ]);
  