From 38381b56056acfdf3b7c854a108923558c145316 Mon Sep 17 00:00:00 2001 From: Roman Timashev Date: Sat, 28 Feb 2015 19:17:40 +0300 Subject: [PATCH] + titles --- client/app.js | 18 ++++++++++++++---- templates/index.html | 6 ++++-- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/client/app.js b/client/app.js index 4b7eee6b..9e86f0ff 100644 --- a/client/app.js +++ b/client/app.js @@ -14,22 +14,26 @@ app.config(function ($locationProvider, $routeProvider) { { name: "/", templateUrl: "/views/home.html", - controller: "HomePageController" + controller: "HomePageController", + title:"ДШХ Шлиссельбурга" }, { name: "/schedule", templateUrl: "/views/schedule.html", - controller: "SchedulePageController" + controller: "SchedulePageController", + title:"Расписание" }, { name: "/team", templateUrl: "/views/team.html", - controller: "TeamPageController" + controller: "TeamPageController", + title:"Преподаватели" }, { name: "/docs", templateUrl: "/views/docs.html", - controller: "DocsPageController" + controller: "DocsPageController", + title: "Документы" } ]; @@ -42,6 +46,12 @@ app.config(function ($locationProvider, $routeProvider) { }); }); +app.run(function($location, $rootScope) { + $rootScope.$on("$routeChangeSuccess", function (event, current, previous) { + $rootScope.title = current.$$route.title; + }); +}); + require("./api/api")(app); require("./ui/menu")(app); require("./ui/timeline")(app); diff --git a/templates/index.html b/templates/index.html index 0a1ad8d8..8487343f 100644 --- a/templates/index.html +++ b/templates/index.html @@ -1,9 +1,11 @@ - + + ДШХ Шлиссельбурга + @@ -40,7 +42,7 @@ // ga('send', 'pageview'); - +