Lokesh Kumar Gaurav
Lokesh Kumar Gaurav

Reputation: 726

open one page to other page in angularjs

Plz tell me how to use link to appear other page in angular js I have used below code but it is not being opened

eg.

<form role="form" ng-submit="resetPassword()">
    <div class="form-group">
        <input type="password" class="form-control input-lg" id="username" ng-model="credential.password" placeholder="Password">
    </div>
    <div class="form-group">
        <input type="password" class="form-control input-lg" id="password" ng-model="confirmPassword" placeholder="Confirm Password">
    </div>
    <button type="submit" class="btn btn-lg btn-primary btn-block">Submit</button>

    <div class="form-group m-top15"> <a href="#/index.html">Sign in</a> </div>
</form>

Upvotes: 0

Views: 56

Answers (1)

Akash Goswami
Akash Goswami

Reputation: 306

You can use $window.location.href = '/index.html';

Where $window will be one of your controller dependency.

If you want to use link, ng-href will be used

<a ng-href="http://www.gravatar.com/avatar/{{hash}}">link1</a>

Refer: https://docs.angularjs.org/api/ng/directive/ngHref

Upvotes: 1

Related Questions