Answer the question
In order to leave comments, you need to log in
How to set up transition between pages in Angular?
Hello, please tell me how to properly set up transitions between pages.
To display menu items, I use an array of entries:
$scope.lists = [
{'name': 'Home'},
{'name': 'SERVICES'} ...
<li ng-repeat="list in lists">
<a href="/">{{list.name}}</a>
$routeProvide
.when('/',{
templateUrl:'template/home.html',
controller:'PhoneListCtrl'
})
.when('/SERVICES',{
templateUrl:'template/SERVICES.html',
controller:'servCntrl'
}) ...
Answer the question
In order to leave comments, you need to log in
Links must begin with a # sign or with !# signs , if search engine optimization is needed, then it will not be redirected. Also, use ng-href .
There is a clear error here:
<li ng-repeat="list in lists">
<a href="/">{{list.name}}</a>
</li>
<li ng-repeat="item in links">
<a ng-href="#/{{ item.link }}">{{ item.title }}</a>
</li>
links = [
{ link: 'contacts', title: 'Контакты' },
{ link: 'profile', title: 'Профиль' }
];
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question