angularjs - NG-Show based upon refering URL -
can use ng-show display button based upon internal page user came from.
for example:
have 3 pages: home, about, middle man.
two buttons: home, about.
on middle man page want 1 button display based upon page user on prior.
<button ng-show="?">back home</button> <button ng-show="?">back about</button>
yes can. can store last visited page using factory
example , display correct buttons based on value. factory
should this:
myapp.factory('historyfactory', function() { var _lastvisitedpage; return { setlastvisitedpage: function(page) { _lastvisitedpage = page; }, getlastvisitedpage: function() { return _lastvisitedpage; } } });
Comments
Post a Comment