1

Use Angular JS ui.router in project.

I have added the following state map in app.js:

.state( 'confirmCart', {
    url: "/cart/confirmCart",
    controller: "ConfirmCartCtrl",
    templateUrl: "/ng-apps/selfEnroll/pages/confirmCart/confirmCart.html"
} )

Added a function in control.js:

$scope.reviewCart = function() {
    $state.go("confirmCart");
    return;
}

Added a button on home page:

<div>
 <button ng-click="reviewCart()">Review Cart Plans</button>
</div>

And then set the view area div use the 'ui-view' attribute.

<div class="container">
    <div ui-view></div>
</div>

$state.go() does not load the view when first click this button, but the template Url was changed in browser address field. However, the view shows when second click.

I notice that when click fist time, the view page loaded under the browser developer tool 'Network' tab. But the view page is not showing in the window. This view has to be displayed by the second click of the button. I am confused that.

Screenshot of the developer tools shows

1 Answer 1

0

Try this:

$state.go("confirmCart", {}, {reload: true});

Or this:

$state.go("confirmCart").then( () => $state.reload() )

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.