Skip to content

Commit 3232b4e

Browse files
committed
refactor(demo): resolve JSHint warnings
- Use $log instead of console as it's safer and always defined - JSHint thinks usage of alert is possibly development code, so use $window.alert instead
1 parent 34273ff commit 3232b4e

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

src/dropdown/docs/demo.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
angular.module('ui.bootstrap.demo').controller('DropdownCtrl', function ($scope) {
1+
angular.module('ui.bootstrap.demo').controller('DropdownCtrl', function ($scope, $log) {
22
$scope.items = [
33
'The first choice!',
44
'And another choice for you.',
@@ -10,7 +10,7 @@ angular.module('ui.bootstrap.demo').controller('DropdownCtrl', function ($scope)
1010
};
1111

1212
$scope.toggled = function(open) {
13-
console.log('Dropdown is now: ', open);
13+
$log.log('Dropdown is now: ', open);
1414
};
1515

1616
$scope.toggleDropdown = function($event) {

src/pagination/docs/demo.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
angular.module('ui.bootstrap.demo').controller('PaginationDemoCtrl', function ($scope) {
1+
angular.module('ui.bootstrap.demo').controller('PaginationDemoCtrl', function ($scope, $log) {
22
$scope.totalItems = 64;
33
$scope.currentPage = 4;
44

@@ -7,7 +7,7 @@ angular.module('ui.bootstrap.demo').controller('PaginationDemoCtrl', function ($
77
};
88

99
$scope.pageChanged = function() {
10-
console.log('Page changed to: ' + $scope.currentPage);
10+
$log.log('Page changed to: ' + $scope.currentPage);
1111
};
1212

1313
$scope.maxSize = 5;

src/tabs/docs/demo.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
angular.module('ui.bootstrap.demo').controller('TabsDemoCtrl', function ($scope) {
1+
angular.module('ui.bootstrap.demo').controller('TabsDemoCtrl', function ($scope, $window) {
22
$scope.tabs = [
33
{ title:'Dynamic Title 1', content:'Dynamic content 1' },
44
{ title:'Dynamic Title 2', content:'Dynamic content 2', disabled: true }
55
];
66

77
$scope.alertMe = function() {
88
setTimeout(function() {
9-
alert('You\'ve selected the alert tab!');
9+
$window.alert('You\'ve selected the alert tab!');
1010
});
1111
};
1212
});

src/timepicker/docs/demo.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
angular.module('ui.bootstrap.demo').controller('TimepickerDemoCtrl', function ($scope) {
1+
angular.module('ui.bootstrap.demo').controller('TimepickerDemoCtrl', function ($scope, $log) {
22
$scope.mytime = new Date();
33

44
$scope.hstep = 1;
@@ -22,7 +22,7 @@ angular.module('ui.bootstrap.demo').controller('TimepickerDemoCtrl', function ($
2222
};
2323

2424
$scope.changed = function () {
25-
console.log('Time changed to: ' + $scope.mytime);
25+
$log.log('Time changed to: ' + $scope.mytime);
2626
};
2727

2828
$scope.clear = function() {

0 commit comments

Comments
 (0)