0

I was trying to navigate to different page by using href. Below is my html and routing code.

  function configPaths($routeProvider){

 $routeProvider.
 when('/catalog',{
     templateUrl:'app/views/catalog.tmpl.html',
     controller:'catalogController',
     controllerAs:'catalogCtrl'
 }).
 when('/',{
     templateUrl:'app/views/login.tmpl.html',
     controller:'loginController',
     controllerAs:'lgnCtrl'


 }).
     when('/signup',{
     templateUrl:'app/views/signup.tmpl.html',
     controller:'signUpController',
     controllerAs:'signUpCtrl'
 })

 ;

     }
<div class="container">
    <div class="page-header">Login</div>
<div class="row">
    <div class="col-sm-8 col-xs-offset-2">
        <form name="loginForm" novalidate ng-submit="lgnCtrl.submitDetails()">


            <div  class="form-group" ng-class="{ 'has-error': loginForm.username.$invalid && loginForm.username.$dirty}">
                <label>User Name</label>
                <input type="text" class="form-control" name="username" ng-model="lgnCtrl.user.username" required ng-minlength="4" >
                <div ng-messages="loginForm.username.$error" ng-if="loginForm.username.$dirty">
                    <p class="help-block" ng-message="required">User Name is required</p>
                    <p class="help-block" ng-message="minlength">User Name should be atleast 4 chars</p>
                </div>
            </div>
            <div class="form-group" ng-class="{'has-error':loginForm.password.$invalid && loginForm.password.$dirty}">
                <label>Password</label>
                <input type="password" name="password" class="form-control" ng-model="lgnCtrl.user.password" required ng-minlength="4">
                <div ng-messages="loginForm.password.$error" ng-if="loginForm.password.$dirty">
                    <p class="help-block" ng-message="required">Password is required</p>
                    <p class="help-block" ng-message="minlength">Password should be atleast 4 chars</p>
                </div>
            </div>
            <button type="submit" class="btn btn-primary">Submit</button>
        </form>
    </div>

</div>
    <div class="row">
        <a href="#/signup">Sign Up</a>
    </div>

</div>

Can someone tell me what is wrong with my code. I guess I configured routing information correctly.

Appreciate any help.

Thank you

dharan
  • 743
  • 2
  • 10
  • 28

0 Answers0