Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
  • How to go back from a page using window.history.back in angularjs?

    • 0
    • 3
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 5.36k
    Comment on it

    We can use the history.back() method which loads the previous URL in the history list. It functions the same as clicking the Back button in the browser.

    Here is the code snippet to show it's usage :,

    <header ng-controller="menuController">
        <h1 class="ui-title">Send tip</h1>
    <section class="midArea">
        <div class="form-horizontal ui-content">
            <p id="newback" ng-click="backButton()"> Back </p>

    Now this is the code to be included in your js :

    $scope.backButton= function(){
            window.plugins.nativepagetransitions.slide( {
                        "direction": 'left',
                        "href" : window.history.back()
                    } );

    I have used a native page transition plugin for animated transitions between the views. You can simply use the window.history.back method.

 0 Comment(s)

Sign In

Sign up using

Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: