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
angular
.module('myApp', [
'ui.router',
'ui.bootstrap',
'ngAnimate',
'ngCookies',
'ngResource',
'ngRoute',
'ngSanitize',
'ngTouch',
'duScroll'
])
.run(function ($rootScope, $location, $state, $stateParams, $document) {
$rootScope.googleMapsUrl = 'https://maps.googleapis.com/maps/api/js?key=AIzaSyB6WfNGSikZtPSZxMisKcHuPgPbb8Q97s8';
$rootScope.$on('$stateChangeSuccess', function () {
$document.scrollTopAnimated(0);
$rootScope.$state = $state;
});
})
.controller('appCtrl', function ($location, $scope) {
$scope.scrollTo = function (hash) {
$location.hash(hash);
};
})
.config(function ($stateProvider, $urlRouterProvider, $locationProvider) {
// For any unmatched url, redirect to /state1
$urlRouterProvider.otherwise('/');
// Uncomment for production
$locationProvider.html5Mode(true);
$stateProvider
.state('home', {
url: '/',
templateUrl: 'views/main/home.html'
})