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