What is the best way to direct the user to the home page if they are updated from any other route (or indicate if you are using ui-router, like me).
For example, I want them to start on a page inventory. If they want to make changes, they are moved to the page edits, but if they refresh this page, they are redirected to the route inventory.
inventory
edits
I did not use ui-router, but in the ng route we can do it like
<body ng-controller="topController"> <div ng-view></div> </body>
$location.path( "/" )
, "/" - , , $location
window.onbeforeunload = function() { window.setTimeout(function () { window.location = 'homeURL'; }, 0); window.onbeforeunload = null; }
Assume #/inventory- your route, useotherwise
#/inventory
otherwise
$urlRouterProvider.otherwise("/inventory");
See URL Routing - $ urlRouterProvider
Source: https://habr.com/ru/post/1540807/More articles:javax.naming.AuthenticationException: [LDAP: error code 49 - invalid credentials] - javaDynamically positioning scroll element - javascriptJNA getFieldOrder () yields names that are not comparable in comparison HashSet () (JNA Structure.java, line 925) - javaCan't resolve u'slug 'keyword in a field error in Django? - djangoHow to change laravel color on command line? - laravelHow can I get the Iteration number of an example script - c #Преобразование мантии с вложенными словарями - jsonHow to delete a form already created in Tkinter canvas? - pythonConvert NSString to NSURL in JSON array with mantle - objective-cIs it possible to delete an embedded document in Mongoid without saving? - ruby | fooobar.comAll Articles