filters.js
1.34 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
angular.module('confjuvapp.filters', []).
filter('htmlToPlainText', function() {
return function(text) {
return String(text).replace(/<[^>]+>/gm, '');
};
}).
filter('categoryType', function() {
return function(categories, type) {
for (var i = 0; i < categories.length; i++) {
if (categories[i].type.toLowerCase() == type) {
return categories[i].name;
}
}
};
}).
filter('tagFilter', function() {
return function(text) {
return String(text).replace(/#/gm, '');
};
}).
filter('etniaFilter', function() {
return function(type) {
var etnia = {};
etnia[1] = 'Pardo';
etnia[2] = 'Preto';
etnia[3] = 'Branco';
etnia[4] = 'Indígena';
etnia[5] = 'Amarelo';
return etnia[type];
};
}).
filter('orientacaoSexualFilter', function() {
return function(type) {
var orientacao = {};
orientacao[1] = 'Homosexual';
orientacao[2] = 'Heterosexual';
orientacao[3] = 'Bisexual';
orientacao[4] = 'Assexual';
return orientacao[type];
};
}).
filter('generoFilter', function() {
return function(type) {
var genero = {};
genero[1] = 'Masculino';
genero[2] = 'Feminino';
return genero[type];
};
}).
filter('membroConselhoFilter', function() {
return function(type) {
var membro = {};
membro[1] = 'Sim';
membro[2] = 'Não';
return membro[type];
};
});