Skip to content

Commit e59f7e6

Browse files
committed
add url parameter to stats component
1 parent 6d1cba1 commit e59f7e6

File tree

3 files changed

+24
-17
lines changed

3 files changed

+24
-17
lines changed

app/scripts/directives/dashboard/stats/stats.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@
1111
</div>
1212
</div>
1313
</div>
14-
<a href="#">
14+
<a href="{{url}}">
1515
<div class="panel-footer">
1616
<span class="pull-left">View Details</span>
1717
<span class="pull-right"><i class="fa fa-arrow-circle-right"></i></span>
1818
<div class="clearfix"></div>
1919
</div>
2020
</a>
2121
</div>
22-
</div>
22+
</div>
Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
/* jshint -W097 */
2+
/* global angular, console */
13
'use strict';
24

35
/**
@@ -7,20 +9,25 @@
79
* # adminPosHeader
810
*/
911
angular.module('sbAdminApp')
10-
.directive('stats',function() {
11-
return {
12-
templateUrl:'scripts/directives/dashboard/stats/stats.html',
13-
restrict:'E',
14-
replace:true,
15-
scope: {
12+
.directive('stats', function() {
13+
return {
14+
templateUrl: 'scripts/directives/dashboard/stats/stats.html',
15+
restrict: 'E',
16+
replace: true,
17+
scope: {
1618
'model': '=',
1719
'comments': '@',
1820
'number': '@',
1921
'name': '@',
2022
'colour': '@',
21-
'details':'@',
22-
'type':'@'
23-
}
24-
25-
}
23+
'details': '@',
24+
'type': '@',
25+
'url': '@?'
26+
},
27+
compile: function(element, attrs) {
28+
if (!attrs.url) {
29+
attrs.url = '#';
30+
}
31+
},
32+
};
2633
});

app/views/dashboard/home.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ <h1 class="page-header">Dashboard</h1>
77
</div>
88
<!-- /.row -->
99
<div class="row">
10-
11-
<stats number="6" comments="New comments!" colour="primary" type="comments"></stats>
10+
11+
<stats number="6" comments="New comments!" colour="primary" type="comments" url="#/dashboard/table"></stats>
1212
<stats number="12" comments="New tasks!" colour="primary" type="user"></stats>
1313
<stats number="18" comments="New orders!" colour="yellow" type="shopping-cart"></stats>
1414
<stats number="24" comments="Support tickets!" colour="red" type="support"></stats>
1515

1616
</div>
17-
17+
1818
<!-- /.panel -->
1919
<div class="row">
2020
<div class="col-lg-8">
@@ -35,7 +35,7 @@ <h1 class="page-header">Dashboard</h1>
3535
<i class="fa fa-bell fa-fw"></i> Notifications Panel
3636
</div>
3737
<!-- /.panel-heading -->
38-
<notifications></notifications>
38+
<notifications></notifications>
3939
<!-- /.panel-body -->
4040
</div>
4141
<!-- /.panel -->

0 commit comments

Comments
 (0)