Answer the question
In order to leave comments, you need to log in
Is it possible to use global variables in the page header without a controller?
<html lang="en" ng-app="birthdayApp">
<div class="container">
<div class="header">
<ul class="nav nav-pills pull-right">
<li ng-class="todayClass"><a href="#/today">Сегодня</a></li>
<li ng-class="tomorrowClass"><a href="#/tomorrow">Завтра</a></li>
<li ng-class="monthClass"><a href="#/month">Месяц</a></li>
<li ng-class="annivClass"><a href="#/anniversary">Юбилеи</a></li>
</ul>
<h3 class="text-muted">Дни рождения</h3>
</div>
</div> <!-- /container -->
...
<div ng-view></div>
</hrml>
birthdayApp.config(['$routeProvider',
function($routeProvider) {
$routeProvider.
when('/today', {
templateUrl: 'views/today.html',
controller: 'TodayBirthCtrl'
}).
when('/month', {
templateUrl: 'views/month.html',
controller: 'MonthBirthCtrl'
}).
when('/tomorrow', {
templateUrl: 'views/tomorrow.html',
controller: 'TomorrowBirthCtrl'
}).
when('/anniversary', {
templateUrl: 'views/anniversary.html',
controller: 'AnniversaryCtrl'
}).
otherwise({
redirectTo: '/today'
});
}]);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question