-
Notifications
You must be signed in to change notification settings - Fork 108
Expand file tree
/
Copy pathapp.js
More file actions
75 lines (63 loc) · 2.3 KB
/
app.js
File metadata and controls
75 lines (63 loc) · 2.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
(function () {
'use strict';
var docs = angular.module('btorfs.multiselect.docs', ['btorfs.multiselect', 'vk.beautify', 'hljs']);
docs.controller('DocsController', ['$scope', '$q', '$timeout', function ($scope, $q, $timeout) {
$scope.options = ['France', 'United Kingdom', 'Germany', 'Belgium', 'Netherlands', 'Spain', 'Italy', 'Poland', 'Austria'];
$scope.options2 = [
{
id: '1',
name: 'France',
capital: 'Paris'
},
{
id: '2',
name: 'United Kingdom',
capital: 'London'
},
{
id: '3',
name: 'Germany',
capital: 'Berlin'
}
];
$scope.options3 = [];
_.forEach(_.range(0, 100000), function (number) {
$scope.options3.push({
name: 'country' + number,
id: number
});
});
$scope.fnOptions = function () {
return $q(function (resolve, reject) {
$timeout(function () {
resolve([$scope.searchFilter + '1', $scope.searchFilter + '2'])
}, 1000);
});
}
$scope.embed = '<script src="bower_components/angular-bootstrap-multiselect/dist/angular-bootstrap-multiselect.min.js"></script>';
$scope.labels = { itemsSelected: 'éléments sélectionnés',
selectAll: 'Tout Selectionner',
unselectAll: 'Tout Déselectionner',
search: 'Cherchez',
select: 'Selectez'
};
}]);
docs.filter('prettyprint', ['vkBeautify', function (vkBeautify) {
return function (data) {
if (angular.isObject(data)) {
data = angular.toJson(data);
}
if (data) {
if (data.charAt(0) === '<') {
return vkBeautify.xml(data);
} else if (data.charAt(0) === '{' || data.charAt(0) === '[') {
return vkBeautify.json(data);
} else {
return data;
}
} else {
return data;
}
};
}]);
}());