Is there any functional difference between ui-sref
and $state.go()
?
ui-sref
is used in <a>...</a>
and $state.go('someState')
is used in a controller.
In HTML, I would use:
<a ui-sref="currentState.state1">Link</a>
whereas in a function I would use something like:
if(someCondition) {
$state.go('currentState.state1');
}
So, is that it or do I need to add something after $state.go()
? Assuming current state is currentState
.