Skip to content

Commit 0c81b2d

Browse files
mrzepinskimrzepinski
authored andcommitted
1.1.0 release
1 parent e8347cc commit 0c81b2d

19 files changed

Lines changed: 861 additions & 798 deletions

.editorconfig

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# http://editorconfig.org
2+
root = true
3+
4+
[*]
5+
indent_style = space
6+
indent_size = 2
7+
charset = utf-8
8+
trim_trailing_whitespace = true
9+
insert_final_newline = true
10+
11+
[*.md]
12+
trim_trailing_whitespace = false

.jshintrc

Lines changed: 0 additions & 40 deletions
This file was deleted.

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,16 @@ You can disable all default loaded plugins.
4040
}]);
4141
~~~~
4242

43+
`clearDefaultPlugins` takes one argument:
44+
* keepPlugins [Array][optional] - you can keep some plugins after clear action
45+
4346
#### Change refresh interval
4447

4548
You can set your own interval time. Default is `1000 ms`.
4649

4750
~~~~javascript
4851
.config(['debugBarProvider', function (debugBarProvider) {
49-
debugBarProvider.setRefreshInterval(10000);
52+
debugBarProvider.setRefreshInterval(1000);
5053
}]);
5154
~~~~
5255

bower.json

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "angular-debug-bar",
3-
"version": "1.0.0",
3+
"version": "1.1.0",
44
"author": "Maciej Rzepinski",
55
"description": "AngularJS Debug Bar",
66
"homepage": "https://github.com/mrzepinski/angular-debug-bar",
@@ -16,16 +16,13 @@
1616
".jshintrc"
1717
],
1818
"devDependencies": {
19-
"angular": "1.3.15",
20-
"angular-route": "1.3.15"
19+
"angular": ">=1.2.0",
20+
"angular-route": ">=1.2.0"
2121
},
2222
"licenses": [
2323
{
2424
"type": "MIT",
2525
"url": "http://www.opensource.org/licenses/MIT"
2626
}
27-
],
28-
"resolutions": {
29-
"angular": "1.3.15"
30-
}
27+
]
3128
}

demo/app/bootstrap.js

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,26 @@
11
(function (window, angular, undefined) {
2-
'use strict';
2+
'use strict';
3+
angular.module('adb', [
4+
'ngRoute',
5+
'adb.routing',
6+
'angular-debug-bar',
7+
'adb.controllers'
8+
]).config(appConfig);
39

4-
angular.module('adb', [
5-
'ngRoute',
6-
'adb.routing',
7-
'angular-debug-bar',
8-
'adb.controllers'
9-
]).config(['debugBarProvider', function (debugBarProvider) {
10-
// change interval
11-
debugBarProvider.setRefreshInterval(2000);
10+
appConfig.$inject = ['debugBarProvider'];
1211

13-
// clear all default plugins
14-
debugBarProvider.clearDefaultPlugins();
12+
function appConfig (debugBarProvider) {
13+
debugBarProvider.setRefreshInterval(2000);
14+
debugBarProvider.clearDefaultPlugins();
15+
debugBarProvider.registerPlugin('numberOfRequests', numberOfRequests, {
16+
label: 'Number of requests'
17+
});
18+
}
1519

16-
// register only one custom plugin
17-
debugBarProvider.registerPlugin('numberOfRequests', function () {
18-
if ('getEntriesByType' in window.performance) {
19-
return window.performance.getEntriesByType('resource').length
20-
}
21-
return 'N/A';
22-
}, {
23-
label: 'Number of requests'
24-
});
25-
}]);
26-
27-
}(window, window.angular));
20+
function numberOfRequests () {
21+
if ('getEntriesByType' in window.performance) {
22+
return window.performance.getEntriesByType('resource').length
23+
}
24+
return 'N/A';
25+
}
26+
}(window, window.angular));

demo/app/controllers.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
(function (angular, undefined) {
2-
'use strict';
3-
4-
angular.module('adb.controllers', []);
5-
6-
}(window.angular));
2+
'use strict';
3+
angular.module('adb.controllers', []);
4+
}(window.angular));

demo/app/home/HomeCtrl.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
(function (angular, undefined) {
2-
'use strict';
2+
'use strict';
3+
angular.module('adb.controllers')
4+
.controller('HomeCtrl', HomeCtrl);
35

4-
angular.module('adb.controllers').controller('HomeCtrl', ['$scope', function ($scope) {}]);
6+
HomeCtrl.$inject = ['$scope'];
57

6-
}(window.angular));
8+
function HomeCtrl ($scope) {}
9+
}(window.angular));

demo/app/routing.js

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
(function (angular, undefined) {
2-
'use strict';
2+
'use strict';
3+
angular.module('adb.routing', [])
4+
.config(routeConfig);
35

4-
angular.module('adb.routing', []).config(['$routeProvider', function ($routeProvider) {
6+
routeConfig.$inject = ['$routeProvider'];
57

6-
$routeProvider
7-
.when('/home', {
8-
templateUrl: 'app/home/home.html',
9-
controller: 'HomeCtrl'
10-
})
11-
.when('/test', {
12-
templateUrl: 'app/test/test.html',
13-
controller: 'TestCtrl'
14-
})
15-
.otherwise({
16-
redirectTo: '/home'
17-
});
18-
19-
}]);
20-
21-
}(window.angular));
8+
function routeConfig ($routeProvider) {
9+
$routeProvider.when('/home', {
10+
templateUrl: 'app/home/home.html',
11+
controller: 'HomeCtrl'
12+
});
13+
$routeProvider.when('/test', {
14+
templateUrl: 'app/test/test.html',
15+
controller: 'TestCtrl'
16+
});
17+
$routeProvider.otherwise({
18+
redirectTo: '/home'
19+
});
20+
}
21+
}(window.angular));

demo/app/test/TestCtrl.js

Lines changed: 28 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,31 @@
11
(function (angular, undefined) {
2-
'use strict';
2+
'use strict';
3+
angular.module('adb.controllers')
4+
.controller('TestCtrl', TestCtrl);
35

4-
angular.module('adb.controllers').controller('TestCtrl', ['$scope', function ($scope) {
6+
TestCtrl.$inject = ['TestCtrl'];
57

6-
$scope.books = [
7-
{
8-
title: 'ng-book',
9-
authors: [
10-
{
11-
name: 'Ari Lerner'
12-
}
13-
]
14-
},
15-
{
16-
title: 'AngularJS',
17-
authors: [
18-
{
19-
name: 'Brad Green'
20-
},
21-
{
22-
name: 'Shyam Seshadri'
23-
}
24-
]
25-
}
26-
];
27-
28-
}]);
29-
30-
}(window.angular));
8+
function TestCtrl ($scope) {
9+
$scope.books = [
10+
{
11+
title: 'ng-book',
12+
authors: [
13+
{
14+
name: 'Ari Lerner'
15+
}
16+
]
17+
},
18+
{
19+
title: 'AngularJS',
20+
authors: [
21+
{
22+
name: 'Brad Green'
23+
},
24+
{
25+
name: 'Shyam Seshadri'
26+
}
27+
]
28+
}
29+
];
30+
}
31+
}(window.angular));

demo/app/test/test.html

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ <h2>AngularJS Books</h2>
33
<p>More values, watches and DOM objects.</p>
44

55
<ul>
6-
<li ng-repeat="book in books track by $index">
7-
<strong>{{ book.title }}</strong>
8-
- author[s]:
9-
<span ng-repeat="author in book.authors track by $index">
10-
{{ author.name }}{{ !$last ? ', ' : '' }}
11-
</span>
12-
</li>
13-
</ul>
6+
<li ng-repeat="book in books track by $index">
7+
<strong>{{ book.title }}</strong>
8+
- author[s]:
9+
<span ng-repeat="author in book.authors track by $index">
10+
{{ author.name }}{{ !$last ? ', ' : '' }}
11+
</span>
12+
</li>
13+
</ul>

0 commit comments

Comments
 (0)