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

Commit bd1293d

Browse files
author
Erin Altenhof-Long
committed
test(ngHint): add ngHint bootstrapping example apps
1 parent a899b67 commit bd1293d

15 files changed

+151
-2
lines changed

e2e/allHint/allHint.html

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<div>
2+
<div id="title">All Hint Example</div>
3+
<div id="test">
4+
This is a test div that the controller will attempt to remove. Such manipulation
5+
of the DOM will cause ng-hint-dom to log a message if it is loaded correctly
6+
by the ng-hint tag. Including the ng-hint tag with no parameters should include all the modules.
7+
</div>
8+
<br>
9+
<div id="directiveTest" ng-cick="">
10+
This is another test div that uses a mispelled directive. If ng-hint-directives is correctly
11+
loaded, a message would be logged.
12+
</div>
13+
</div>

e2e/allHint/app-controller.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
angular.module('sampleAllHint').
2+
controller('AllController', ['$scope', function($scope) {
3+
var element = document.getElementById('test');
4+
}]);

e2e/allHint/app.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
angular.module('sampleAllHint', ['ngRoute']).
2+
config(['$routeProvider', function($routeProvider) {
3+
$routeProvider.when('/allHint', {
4+
controller: 'AllController',
5+
controllerAs: 'allCtrl',
6+
templateUrl: 'allHint.html'
7+
}).
8+
otherwise({redirectTo: '/allHint'});
9+
}]);
10+

e2e/allHint/index.html

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<!doctype html>
2+
<html ng-app="sampleAllHint">
3+
<head>
4+
<meta charset="utf-8">
5+
<title>Angular Hint Example</title>
6+
7+
<script src="../../bower_components/angular/angular.js"></script>
8+
<script src="../../bower_components/angular-route/angular-route.js"></script>
9+
<script src="../../dist/hint.js"></script>
10+
11+
<script src="app.js"></script>
12+
<script src="app-controller.js"></script>
13+
14+
</head>
15+
<body ng-hint>
16+
<div ng-view></div>
17+
</body>
18+
</html>

e2e/exclusiveHint/app-controller.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
angular.module('sampleExclusiveHint').
2+
controller('ExclusiveController', ['$scope', function($scope) {
3+
var element = document.getElementById('test');
4+
}]);

e2e/exclusiveHint/app.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
angular.module('sampleExclusiveHint', ['ngRoute']).
2+
config(['$routeProvider', function($routeProvider) {
3+
$routeProvider.when('/exclusiveHint', {
4+
controller: 'ExclusiveController',
5+
controllerAs: 'exclusiveCtrl',
6+
templateUrl: 'exclusiveHint.html'
7+
}).
8+
otherwise({redirectTo: '/exclusiveHint'});
9+
}]);
10+

e2e/exclusiveHint/exclusiveHint.html

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<div>
2+
<div id="title">Exclusive Hint Example</div>
3+
<div id="test">
4+
This is a test div that the controller will attempt to remove. Such manipulation
5+
of the DOM will cause ng-hint-dom to log a message if it is loaded correctly
6+
by the ng-hint-exclude tag. Only ng-hint-directives is listed in the ng-hint-exclude. Therefore,
7+
all other modules should be loaded.
8+
</div>
9+
<br>
10+
<div id="directiveTest" ng-cick="">
11+
This is another test div that uses a mispelled directive. If ng-hint-directives was
12+
loaded, a message would be logged. However, the ng-hint-exclude excludes 'directives', so there
13+
should be no message about this error.
14+
</div>
15+
</div>

e2e/exclusiveHint/index.html

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<!doctype html>
2+
<html ng-app="sampleExclusiveHint">
3+
<head>
4+
<meta charset="utf-8">
5+
<title>Angular Hint Example</title>
6+
7+
<script src="../../bower_components/angular/angular.js"></script>
8+
<script src="../../bower_components/angular-route/angular-route.js"></script>
9+
<script src="../../dist/hint.js"></script>
10+
11+
<script src="app.js"></script>
12+
<script src="app-controller.js"></script>
13+
14+
</head>
15+
<body ng-hint-exclude="directives">
16+
<div ng-view></div>
17+
</body>
18+
</html>

e2e/inclusiveHint/app.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,5 @@ angular.module('sampleInclusiveHint', ['ngRoute']).
77
}).
88
otherwise({redirectTo: '/inclusiveHint'});
99
}]);
10+
11+

e2e/inclusiveHint/inclusiveHint.html

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
11
<div>
2-
<div id="test"></div>
2+
<div id="title">Inclusive Hint Example</div>
3+
<div id="test">
4+
This is a test div that the controller will attempt to remove. Such manipulation
5+
of the DOM will cause ng-hint-dom to log a message if it is loaded correctly
6+
by the ng-hint-include tag.
7+
</div>
8+
<br>
9+
<div id="directiveTest" ng-cick="">
10+
This is another test div that uses a mispelled directive. If ng-hint-directives was
11+
loaded, a message would be logged. However, the ng-hint-include only has 'dom', so there
12+
should be no message about this error.
13+
</div>
314
</div>

e2e/inclusiveHint/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<script src="app-controller.js"></script>
1313

1414
</head>
15-
<body ng-hint-include="dom">
15+
<body ng-hint-include="directives">
1616
<div ng-view></div>
1717
</body>
1818
</html>

e2e/noHint/app-controller.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
angular.module('sampleNoHint').
2+
controller('NoController', ['$scope', function($scope) {
3+
var element = document.getElementById('test');
4+
}]);

e2e/noHint/app.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
angular.module('sampleNoHint', ['ngRoute']).
2+
config(['$routeProvider', function($routeProvider) {
3+
$routeProvider.when('/noHint', {
4+
controller: 'NoController',
5+
controllerAs: 'noCtrl',
6+
templateUrl: 'noHint.html'
7+
}).
8+
otherwise({redirectTo: '/noHint'});
9+
}]);

e2e/noHint/index.html

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<!doctype html>
2+
<html ng-app="sampleNoHint">
3+
<head>
4+
<meta charset="utf-8">
5+
<title>Angular Hint Example</title>
6+
7+
<script src="../../bower_components/angular/angular.js"></script>
8+
<script src="../../bower_components/angular-route/angular-route.js"></script>
9+
<script src="../../dist/hint.js"></script>
10+
11+
<script src="app.js"></script>
12+
<script src="app-controller.js"></script>
13+
14+
</head>
15+
<body>
16+
<div ng-view></div>
17+
</body>
18+
</html>

e2e/noHint/noHint.html

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<div>
2+
<div id="title">No Hint Example</div>
3+
<div id="test">
4+
This is a test div that the controller will attempt to remove. Such manipulation
5+
of the DOM would cause ng-hint-dom to log a message if it was loaded. Since ng-hint is not
6+
being loaded, there should not be a message.
7+
</div>
8+
<br>
9+
<div id="directiveTest" ng-cick="">
10+
This is another test div that uses a mispelled directive. If ng-hint-directives was
11+
loaded, a message would be logged.
12+
</div>
13+
</div>

0 commit comments

Comments
 (0)