snipt

Ctrl+h for KB shortcuts

Text only

Ionic Disable back button

1
2
3
4
5
$ionicHistory.nextViewOptions({
  disableBack: true,
  disableAnimate: true
});
$state.go('app.home');
https://snipt.net/embed/b8571b32a28c397df7834852239ac1f5/
/raw/b8571b32a28c397df7834852239ac1f5/
b8571b32a28c397df7834852239ac1f5
text
Text only
6
2019-07-16T19:08:21
True
False
False
Jun 22, 2016 at 12:22 AM
/api/public/snipt/147270/
ionic-disable-back-button
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a> <a href="#L-5">5</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>$ionicHistory.nextViewOptions({ </span><span id="L-2"><a name="L-2"></a> disableBack: true, </span><span id="L-3"><a name="L-3"></a> disableAnimate: true </span><span id="L-4"><a name="L-4"></a>}); </span><span id="L-5"><a name="L-5"></a>$state.go(&#39;app.home&#39;); </span></pre></div> </td></tr></table>
ionic
1
2
3
4
5
6
7
8
--- 
+++ 
@@ -0,0 +1,5 @@
+$ionicHistory.nextViewOptions({
+  disableBack: true,
+  disableAnimate: true
+});
+$state.go('app.home');