- Same: use class="button"
- Always try to using
ui-sreffirst, just usingng-clickif need to do something (not moving state) or change states dynamic (ui-srefdoesn't support it) - Different:
| <a> | <button> | |
|---|---|---|
| change state/url | use ui-sref="" (no need create more functions, short code if just change state/url and not more complex code) or ng-click="changeUrl()" (use same <button>) |
only way using ng-click="changeUrl()" with $scope.changeUrl = function() { $state.go('tab.posts', {postId: postId});} |
use ng-click |
no effect | having effect. side effect: submit form automatically |