Skip to content
This repository was archived by the owner on Apr 4, 2025. It is now read-only.

Commit 52c218f

Browse files
committed
style(ngHint): improve whitespace and remove verbose code
1 parent f76c7be commit 52c218f

File tree

1 file changed

+11
-14
lines changed

1 file changed

+11
-14
lines changed

hint.js

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,24 @@
1-
//Load angular hint modules
1+
// Load angular hint modules
22
require('angular-hint-dom');
33
require('angular-hint-directives');
44

5-
//List of all possible modules
6-
//The default ng-hint behavior loads all modules
5+
// List of all possible modules
6+
// The default ng-hint behavior loads all modules
77
var allModules = ['ngHintDirectives', 'ngHintDom'];
88

9-
//Determine whether this run is by protractor.
10-
//If protractor is running, the bootstrap will already be deferred.
11-
//In this case resumeBootstrap should be patched to load the hint modules.
12-
var isTest = false;
13-
if(window.name === 'NG_DEFER_BOOTSTRAP!') {
14-
isTest = true;
9+
// Determine whether this run is by protractor.
10+
// If protractor is running, the bootstrap will already be deferred.
11+
// In this case `resumeBootstrap` should be patched to load the hint modules.
12+
if (window.name === 'NG_DEFER_BOOTSTRAP!') {
1513
var originalResumeBootstrap;
1614
Object.defineProperty(angular, 'resumeBootstrap', {
1715
get: function() {
1816
return function(modules) {
19-
return(originalResumeBootstrap.call(angular, modules.concat(loadModules())));
20-
}
17+
return originalResumeBootstrap.call(angular, modules.concat(loadModules()));
18+
};
2119
},
2220
set: function(resumeBootstrap) {
2321
originalResumeBootstrap = resumeBootstrap;
24-
2522
}
2623
});
2724
}
@@ -54,7 +51,7 @@ function loadModules() {
5451
modules = allModules;
5552
}
5653
return modules;
57-
};
54+
}
5855

5956
function excludeModules(modulesToExclude) {
6057
modulesToExclude = modulesToExclude.map(hintModuleName);
@@ -71,6 +68,6 @@ function hintModuleName(name) {
7168
return 'ngHint' + title(name);
7269
}
7370

74-
function title (str) {
71+
function title(str) {
7572
return str[0].toUpperCase() + str.substr(1);
7673
}

0 commit comments

Comments
 (0)