-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsort-panel.js
More file actions
20 lines (19 loc) · 874 Bytes
/
Copy pathsort-panel.js
File metadata and controls
20 lines (19 loc) · 874 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
angular.module('catalog')
.directive('sortPanel', function(){
return {
template:
'<div id="price_sort" class="sort-items">' +
'<div class="sort-name">Сортировать по цене:' +
'<span class="asc"> <a href="" ng-click="sortBy(\'asc\')">по возрастанию</a></span>' +
'<span class="desc"> · <a href="" ng-click="sortBy(\'desc\')">по убыванию</a></span>' +
'<span class="cancel" style="display: inline-block;"> · <a href="" ng-click="sortBy(\'rand\')">отменить</a></span>' +
'</div>' +
'</div>',
restrict: 'E',
controller: function($scope, $element, $attrs) {
$scope.sortBy = function(type) {
$scope.$broadcast('sort', type);
};
}
};
});