Angular 1.x에서 매우 간단한 scrollTo를 사용하려고합니다. 클릭하면 div # id로 스크롤해야하는 naviagation 메뉴 링크가 있습니다. 나는 이것을 '약속 (약속)'으로 만 작동시킬 수 있습니다.약속이없는 각도 앵커 스크롤
<li><a href="#" ng-click="tracking()">Go to Tracking</a></li>
$scope.tracking = function() { // go to tracking when header button is clicked
$http.get('/includes/modules/get_home_destinations.php')
.then(function(reply){
if (reply.data) {
$scope.destinations = reply.data;
$location.hash('home-tracking');
}
});
};
을하지만이 응답하지 않습니다 :
예를 들어,이 작품
$scope.tracking = function() { // go to tracking when header button is clicked
$location.hash('home-tracking');
};
그것은 약속이 필요한 경우로, 그러나이없이 간단한 클릭에 일하러 가야 약속?
'href = "#"'없이 시도 할 수 있습니까? –
@MuhammedHasanCelik 작동했습니다! href가 문제를 일으키는 이유는 무엇입니까? –