How to link to a section of a page html using angularjs

I am having a website made using angular js , when I click to a link it goes to a section a page , but it changing the url like ",.com/#compare" but when I again click the link it does not going to that section…

can you provide your code?
there are no seers or mind-readers here, people need to see your code to help you

This is my code:

 <a ng-href="#services" >

And app.js code is

  .module('myApp', [
.run(function ($rootScope, $location, $state, $stateParams, $document) {
    $rootScope.googleMapsUrl = '';
    $rootScope.$on('$stateChangeSuccess', function () {
      $rootScope.$state = $state;

.controller('appCtrl', function ($location, $scope) {
    $scope.scrollTo = function (hash) {

  .config(function ($stateProvider, $urlRouterProvider, $locationProvider) {
    // For any unmatched url, redirect to /state1

    // Uncomment for production

      .state('home', {
        url: '/',
        templateUrl: 'views/main/home.html'