Hey guys I am pretty new to Angular.
Users can edit profile settings in profileSettings page.
I have the following on my profile template:
Use the optional onEnter callback which will be called when profileSettings state becomes active to render those two functions :
url like : /profileSettings.html#hashValue
So your code may look like this:
$stateProvider.state('profileSettings', {
url: '/settings',
template: 'settings.html',
controller: 'ProfileSettingsCtrl',
onEnter: function(){
$location.hash('hashValue');
$anchorScroll();
}
});
Note: Remember to add $location
and $anchorScroll
to your dependencies.