本文整理汇总了TypeScript中entcore.idiom.removeAccents方法的典型用法代码示例。如果您正苦于以下问题:TypeScript idiom.removeAccents方法的具体用法?TypeScript idiom.removeAccents怎么用?TypeScript idiom.removeAccents使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类entcore.idiom
的用法示例。
在下文中一共展示了idiom.removeAccents方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1:
$scope.searchGroups = (item: Group) => {
let found = $scope.display.searchGroups && idiom.removeAccents(item.name.toLowerCase()).indexOf(
idiom.removeAccents($scope.display.searchGroups).toLowerCase()
) !== -1;
for (let structureId in $scope.website.published) {
found = found && _.findWhere($scope.website.published[structureId].groups, { id: item.id }) === undefined;
}
return found;
};
示例2: function
return _.filter(this.all, function(user){
var testDisplayName = '', testNameReversed = '', testFullName = '', testFullNameReversed = '';
if(user.displayName){
testDisplayName = lang.removeAccents(user.displayName).toLowerCase();
if(user.displayName.split(' ').length > 0){
testNameReversed = lang.removeAccents(user.displayName.split(' ')[1] + ' '
+ user.displayName.split(' ')[0]).toLowerCase();
}
}
if(user.firstName && user.lastName){
testFullName = lang.removeAccents(user.firstName + ' ' + user.lastName).toLowerCase();
testFullNameReversed = lang.removeAccents(user.lastName + ' ' + user.firstName).toLowerCase();
}
return testDisplayName.indexOf(searchTerm) !== -1 || testNameReversed.indexOf(searchTerm) !== -1
|| testFullName.indexOf(searchTerm) !== -1 || testFullNameReversed.indexOf(searchTerm) !== -1;
});
示例3: setTitleLink
setTitleLink(){
let titleLink = encodeURIComponent(lang.removeAccents(
this.title.replace(/\ |\:|\?|#|%|\$|£|\^|\*|€|°|\(|\)|\[|\]|§|'|"|&|ç|ù|`|=|\+|<|@/g, '')
).toLowerCase());
let i = 1;
let findName = (append) => {
if (_.findWhere(this.website.pages.all, { titleLink: titleLink + append }) !== undefined) {
append = '-' + i;
i++;
return findName(append);
}
else{
return titleLink + append;
}
}
let foundName = findName('');
this.titleLink = foundName;
}
示例4:
const transform = (str: string) => {
return lang.removeAccents(removeSpecialChars(str) //
.toLowerCase()) //case insensitive
.replace(/\s/g, ''); //remove white space
}
示例5: function
$scope.searchDisplayName = function(item){
return !$scope.display.searchText ||
lang.removeAccents(lang.translate(item.displayName)).toLowerCase().indexOf(
lang.removeAccents($scope.display.searchText).toLowerCase()
) !== -1;
};
示例6:
$scope.searchBlocks = (item: Block) => {
return !$scope.display.searchBlocks || idiom.removeAccents(item.keywords.toLowerCase()).indexOf(
idiom.removeAccents($scope.display.searchBlocks).toLowerCase()
) !== -1;
};