Difference between $state.go and $location.path in Angular.js

We know the use of both $location.path and $state.go. $location.path is used to navigate between the screens in your project. $state.go can be used to redirect to some page. To a beginner angular developer it is confusing why we use both in different cases if the purpose is the same. The $location service allows you to manage location object. The $state service is a part of the ui-router module and it allows you to manage routes in an advanced mode. When you are using ui-router use only $state service to manage states and routes. Therefore you will be able to change physical routes without changing states. If you are run in hashbang mode it is preferred to use ui-serf rather than ng-href.