thank_you
thank_you

Reputation: 11107

$state.go and nav direction

I have a ui-sref link.

<a ui-sref="tab.search-results(backTo)" nav-direction="back" class="button no-margin-top bold button-full button-stable">
  <span class="assertive">BACK</span>
</a>

I'm using nav-direction to have the transition go back. How do I do this with $state.go()?

<a ng-click="parts.goBack()" class="button no-margin-top bold button-full button-stable">
  <span class="assertive">BACK</span>
</a>

I don't see this option anywhere.

function goBack( ) {
  // How do I go back via nav direction?
  $state.go('tab.search-results');
}

Upvotes: 3

Views: 1391

Answers (1)

Nikola
Nikola

Reputation: 15038

Use $ionicHistory. It has a goBack([backCount]) function which looks like exactly what you need.

Upvotes: 6

Related Questions