1

I have created an app with AngularJs and Nodejs

I have this router.get() in routes.js file

 router.get('/reset/:token', function(req, res) {
      res.render('pages/dist/reset', {token:req.params.token });
 }

and I passed token parameters to reset.mustache

I have this directive in reset.mustache file :

<div id="wrap" ui-view class="mainview"></div>

and when I run the app loading reset.html files in this ui-view directive. I want to read this parameter from reset.html which is loading to this ui-view. How can I do that?

reset.html file :

<form method="post" class="form-horizontal" style="margin-bottom: 0px !important;">
<div class="panel panel-primary">
    <div class="panel-body">
    <a href="#/"><img src="../assets/img/logo-big-black.png" alt="Logo" style="max-width: 100%;" class="brand" /></a>
        <h4 class="text-center" style="margin-bottom: 25px;">Reset Password</h4>                     
            <div class="form-group">
                <div class="col-sm-12">                                              
                    <div class="input-group">  
                        <span class="input-group-addon">New Password</span>
                        <input type="password" class="form-control" id="password" name="password" ng-model='$parent.$parent.password'>
                    </div>              
                </div>
            </div>
            <div class="form-group">         
                <div class="col-sm-12">
                    <div class="input-group">  
                        <span class="input-group-addon">Confirm Password</span>
                        <input type="password" class="form-control" id="confirm" name="confirm" ng-model='$parent.$parent.confirm'>
                    </div>                        
                </div>
            </div>                         
        <div>
            <button type="submit" ng-click="submit_reset()" class="btn btn-primary">Update Password</button>             
        </div>      
    </div>
</div >                                 

and reset.js file here is $stateProvider for this ui-view directive :

$stateProvider
        //  MULTIPLE NAMED VIEWS =================================
        .state('/', {                                     
            url: '/',                       
            templateUrl: '/views/reset.html' ,                       
            controller : 'RecoverController'                                
        });

   $urlRouterProvider
   /* .when('/:templateFile', {
        templateUrl: function(param) {
          return 'views/' + param.templateFile + '.html';
        }
   }) */
   .otherwise('/');
devRena
  • 327
  • 2
  • 5
  • 12

0 Answers0