Skip to content

Commit

Permalink
refactor(*): remove unnecessary annotations
Browse files Browse the repository at this point in the history
Remove ngInject annotations; general housekeeping.

Closes fgpv-vpgf#39
  • Loading branch information
alyec committed Oct 28, 2015
1 parent 63f91ee commit 9213d2d
Show file tree
Hide file tree
Showing 18 changed files with 20 additions and 55 deletions.
1 change: 0 additions & 1 deletion src/app/common/router/statehelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
}

// TODO: add routing error handling
/* @ngInject */
function statehelper(statehelperConfig) {
var $stateProvider = statehelperConfig.config.$stateProvider;

Expand Down
1 change: 0 additions & 1 deletion src/app/core/common.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
.factory('common', common);

// TODO: add helper function to common
/* @ngInject */
function common($timeout) {
var service = {
$timeout: $timeout
Expand Down
11 changes: 5 additions & 6 deletions src/app/core/config.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,11 @@
.module('app.core')
.factory('configService', configService);

/* @ngInject */
function configService($q, $rootElement, $timeout, $http, configDefaults) {
var initializePromise;
var isInitialized = false;
let initializePromise;
let isInitialized = false;

var service = {
const service = {
data: {},
initialize: initialize,
ready: ready
Expand All @@ -63,8 +62,8 @@

// store the promise and return it on all future calls; this way initialize can be called one time only
initializePromise = $q(function (fulfill, reject) {
var configAttr = $rootElement.attr('th-config');
var configJson;
const configAttr = $rootElement.attr('th-config');
let configJson;

// This function can only be called once.
if (isInitialized) {
Expand Down
2 changes: 0 additions & 2 deletions src/app/core/core.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
(() => {
'use strict';

/**
* @ngdoc function
Expand All @@ -18,7 +17,6 @@

function configBlock($translateProvider, $stateProvider,
$mdThemingProvider, $mdIconProvider, statehelperConfigProvider) {
'ngInject';

configureStateRouting();
configureTranslations();
Expand Down
1 change: 0 additions & 1 deletion src/app/layout/filters-panel-plug.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
.controller('FiltersPanelPlugController', FiltersPanelPlugController);

function FiltersPanelPlugController($rootScope, $state) {
'ngInject';
const self = this;
self.active = true;
self.mode = 'default';
Expand Down
4 changes: 1 addition & 3 deletions src/app/layout/layout.route.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
(function () {
'use strict';
(() => {

/**
* @ngdoc function
Expand All @@ -13,7 +12,6 @@
.module('app.layout')
.run(layoutConfig);

/* @ngInject */
/**
* Sets initial application routes.
* some info: https://github.com/angular-ui/ui-router/wiki/Nested-States-and-Nested-Views
Expand Down
6 changes: 2 additions & 4 deletions src/app/layout/layout.service.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
(function () {
'use strict';
(() => {

/**
* @ngdoc service
Expand All @@ -13,9 +12,8 @@
.module('app.layout')
.factory('layoutService', layoutService);

/* @ngInject */
function layoutService(sideNavigationService, mapNavigationService) {
var service = {
const service = {
sidenav: sideNavigationService,
mapnav: mapNavigationService
};
Expand Down
4 changes: 1 addition & 3 deletions src/app/layout/main-panel-plug.controller.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
(function () {
'use strict';
(() => {

/**
* @ngdoc function
Expand All @@ -14,7 +13,6 @@
.module('app.layout')
.controller('MainPanelPlugController', MainPanelPlugController);

/* @ngInject */
function MainPanelPlugController($rootScope) {
const self = this;
self.active = true;
Expand Down
1 change: 0 additions & 1 deletion src/app/layout/side-panel-plug.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
.controller('SidePanelPlugController', SidePanelPlugController);

function SidePanelPlugController($state) {
'ngInject';
const self = this;

self.active = true;
Expand Down
6 changes: 2 additions & 4 deletions src/app/ui/appbar/appbar.controller.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
(function () {
'use strict';
(() => {

/**
* @ngdoc function
Expand All @@ -14,15 +13,14 @@
.module('app.ui.appbar')
.controller('AppbarController', AppbarController);

/* @ngInject */
/**
* `AppbarController` has lots of garbage code so far, needed to show how the panels are toggled. It should be moved to service.
*
* @param {object} layoutService
* @param {object} $state
*/
function AppbarController(layoutService, $state) {
var self = this;
const self = this;

self.layoutService = layoutService;
self.toggleToc = toggleToc;
Expand Down
2 changes: 0 additions & 2 deletions src/app/ui/common/morph.directive.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/* global TweenLite */
(() => {
'use strict';

/**
* @ngdoc directive
Expand Down Expand Up @@ -30,7 +29,6 @@
.module('app.ui.common')
.directive('rvMorph', rvMorph);

/* @ngInject */
/**
* `rvMorph` directive body.
*
Expand Down
7 changes: 2 additions & 5 deletions src/app/ui/mapnav/mapnav-button.directive.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
(function () {
'use strict';
(() => {

/**
* @ngdoc directive
Expand All @@ -14,14 +13,13 @@
.module('app.ui.mapnav')
.directive('rvMapnavButton', rvMapnavButton);

/* @ngInject */
/**
* `rvMapnavButton` directive body.
*
* @return {object} directive body
*/
function rvMapnavButton() {
var directive = {
const directive = {
restrict: 'E',
templateUrl: 'app/ui/mapnav/mapnav-button.html',
scope: {
Expand All @@ -43,7 +41,6 @@
}
}

/* @ngInject */
/**
* Skeleton controller function.
*/
Expand Down
4 changes: 1 addition & 3 deletions src/app/ui/mapnav/mapnav.controller.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
(function () {
'use strict';
(() => {

/**
* @ngdoc function
Expand All @@ -13,7 +12,6 @@
.module('app.ui.mapnav')
.controller('MapNavigationController', MapNavigationController);

/* @ngInject */
/**
* `MapNavigationController` directive body.
*
Expand Down
4 changes: 1 addition & 3 deletions src/app/ui/metadata/metadata.controller.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
(function () {
'use strict';
(() => {

/**
* @ngdoc function
Expand All @@ -13,7 +12,6 @@
.module('app.ui.metadata')
.controller('MetadataController', MetadataController);

/* @ngInject */
/**
* `MetadataController` skeleton controller.
*/
Expand Down
8 changes: 2 additions & 6 deletions src/app/ui/settings/settings.controller.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
(function () {
'use strict';
(() => {

/**
* @ngdoc function
Expand All @@ -8,15 +7,12 @@
* @description
*
* The `SettingsController` controller handles the settings side panel.
* `SettingsController` skeleton controller.
*/
angular
.module('app.ui.settings')
.controller('SettingsController', SettingsController);

/* @ngInject */
/**
* `SettingsController` skeleton controller.
*/
function SettingsController() {
//var self = this;

Expand Down
4 changes: 1 addition & 3 deletions src/app/ui/sidenav/sidenav.service.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
(function () {
'use strict';
(() => {

/**
* @ngdoc service
Expand All @@ -14,7 +13,6 @@
.module('app.ui.sidenav')
.factory('sideNavigationService', sideNavigationService);

/* @ngInject */
/**
* `sideNavigationService` exposes methods to close/open the side navigation panel.
* @param {object} $mdSidenav
Expand Down
5 changes: 1 addition & 4 deletions src/app/ui/toc/toc.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,12 @@
*
* The `TocController` controller handles the layer selector (or toc) main panel.
* Right now it's hacked together for demo purposes.
* `TocController` has lots of ugly code to handle state switching. Should be rewritten.
*/
angular
.module('app.ui.toc')
.controller('TocController', TocController);

/* @ngInject */
/**
* `TocController` has lots of ugly code to handle state switching. Should be rewritten.
*/
function TocController($state, tocService) {
const self = this;

Expand Down
4 changes: 1 addition & 3 deletions src/app/ui/toolbox/toolbox.controller.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
(function () {
'use strict';
(() => {

/**
* @ngdoc function
Expand All @@ -13,7 +12,6 @@
.module('app.ui.toolbox')
.controller('ToolboxController', ToolboxController);

/* @ngInject */
/**
* `ToolboxController` skeleton controller.
*/
Expand Down

0 comments on commit 9213d2d

Please sign in to comment.