CopyrightController ES6 refactoring

This commit is contained in:
tmshv committed 2016-02-22 02:26:31 +03:00
1 parent a227082638
commit 33b4d0be22
2 files changed
+7 -6

No files matched your search

+2 -1
View File
@@ -12,6 +12,7 @@ import AppController from './controllers/AppController';
import HomeController from './controllers/HomeController'; import HomeController from './controllers/HomeController';
import TeamController from './controllers/TeamController'; import TeamController from './controllers/TeamController';
import DocumentsController from './controllers/DocumentsController'; import DocumentsController from './controllers/DocumentsController';
import CopyrightController from './controllers/CopyrightController';
import RemoveHashtags from './filters/RemoveHashtags'; import RemoveHashtags from './filters/RemoveHashtags';
import RemoveNewline from './filters/RemoveNewline'; import RemoveNewline from './filters/RemoveNewline';
import Strip from './filters/Strip'; import Strip from './filters/Strip';
@@ -105,7 +106,6 @@ app.run(($location, $rootScope, $http) => {
require('./pages/schedule'), require('./pages/schedule'),
require('./pages/gallery'), require('./pages/gallery'),
require('./controllers/ContactsController'), require('./controllers/ContactsController'),
require('./controllers/CopyrightController'),
MainMenu, MainMenu,
Breadcrumbs, Breadcrumbs,
Document, Document,
@@ -116,6 +116,7 @@ app.run(($location, $rootScope, $http) => {
HomeController, HomeController,
TeamController, TeamController,
DocumentsController, DocumentsController,
CopyrightController,
function (app) { function (app) {
app.controller('HomePageController', ($scope) => { app.controller('HomePageController', ($scope) => {
$scope.pageClass = 'page-home'; $scope.pageClass = 'page-home';
@@ -1,10 +1,10 @@
module.exports = function (app) { export default function (app) {
app.controller('CopyrightController', function ($scope, $rootScope) { app.controller('CopyrightController', ($scope, $rootScope) => {
$scope.developer = true; $scope.developer = true;
$scope.now = new Date().getFullYear(); $scope.now = new Date().getFullYear();
$rootScope.$on('$routeChangeSuccess', function (event, current) { $rootScope.$on('$routeChangeSuccess', (event, current) => {
var originalPath; let originalPath;
try{ try{
originalPath = current['$$route'].originalPath; originalPath = current['$$route'].originalPath;
}catch(e){ }catch(e){
@@ -14,4 +14,4 @@ module.exports = function (app) {
$scope.developer = originalPath == '/'; $scope.developer = originalPath == '/';
}); });
}); });
}; };