'How to redirect to another page and call a Function there on Angular ng-click
I have a page where I toggle between areas using angular functions onclick at home.php like
<button class="btn btn-success btn-lg span6" ng-click="settingManage('setup-guide')" ><i class="fa fa-cogs"></i> Guide</button>
<button class="btn btn-info btn-lg span6" ng-click="settingManage('setup-boxes')" ><i class="fa fa-cogs"></i> Manage</button>
And I show their relative content with:
<div class="wizard" ng-if="mainPage == 'setup-guide'">
Guide Content
</div>
And
<div class="setup-area" ng-if="mainPage == 'setup-boxes'">
Manage Content
</div>
This is working fine but the problem I am having is to navigate back from another PHP page to a specific home.php area e.g page2.php to home.php and directly showing the content of say 'setup-guide' content. So, to navigate from page2.php to home.php and call settingManage('setup-guide')
Any idea how this can be achieved?
page2.php has angular enabled and have same angular's js file as home.php
Solution 1:[1]
you can append a query string to your home.php url in page2.php:
<a href="home.php?setting=setup">home</a>
then, on home.php, there should be a script to detect this query string, and perform an action if present:
if (window.location.indexOf('setting') != -1) {
settingManage('setup-guide');
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | mindthefrequency |