300字范文,内容丰富有趣,生活中的好帮手!
300字范文 > angular跳转指定页面_html – angularjs route – 跳转到路由链接上的特定页面部分

angular跳转指定页面_html – angularjs route – 跳转到路由链接上的特定页面部分

时间:2021-06-03 13:20:46

相关推荐

angular跳转指定页面_html – angularjs route – 跳转到路由链接上的特定页面部分

我试图在Angular锚和路由之间进行某种混合……

我确实让它在主页上工作,因为锚定部分在那里,但是,如果我在另一个页面,它不会.

任何人都可以指出我正确的方向如何正确地做,请?

这是我到目前为止所拥有的

freddoApp.config(function($routeProvider, $locationProvider) {

$routeProvider

// route for the home page

.when('/', {

templateUrl : 'pages/home/home.html',

controller : 'mainController'

})

// route for the productos page

.when('/productos', {

templateUrl : 'pages/home/home.html',

controller : 'mainController'

})

// route for the unico page

.when('/unico', {

templateUrl : 'pages/home/home.html',

controller : 'mainController'

})

// route for the sabores page

.when('/sabores', {

templateUrl : 'pages/home/home.html',

controller : 'mainController'

})

// route for the locales page

.when('/locales', {

templateUrl : 'pages/locales/locales.html',

controller : 'storeController'

})

// route for the servicios page

.when('/servicios', {

templateUrl : 'pages/servicios/servicios.html',

controller : 'servicesController'

})

// route for the about page

.when('/about', {

templateUrl : 'pages/about/about.html',

controller : 'aboutController'

})

// route for the contact page

.when('/contact', {

templateUrl : 'pages/contact/contact.html',

controller : 'contactController'

});

// use the HTML5 History API

$locationProvider.html5Mode(true);

});

/………………………../

freddoApp.controller('mainController', function($scope, $location, $anchorScroll) {

$scope.scrollTo = function(id) {

$location.hash(id);

$anchorScroll();

};

/………………………../

(HTML)

Productos Freddo Único Sabores Locales Servicios Nosotros Contacto

谢谢!

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。