- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-06-2019 06:29 AM
We have created a custom Service Portal widget that displays as list of catalog categories and catalog items. We use ng-repeat with orderBy to display and sort the items by name. We have found that the AngularJS orderBy does not correctly handle sorting of characters with accents (or diacritics e.g., “É”). Would appreciate help in finding a workaround.
I found an article that addresses this issue. http://www.janholinka.net/Blog/Article/8
But I need help with understanding how to implement the workaround in a Service Portal widget
Solved! Go to Solution.
- Labels:
-
Service Portal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-11-2019 03:27 PM
Hi Jerome,
The first thing you'll need to do is to create the filter as a dependency. If you go to the form view of the widget, you should see a "Dependencies" related list. From there you'll need to create the new dependency which ultimately is a UI Script containing the angular module (the first code block in your blog post).
You may get an error from ServiceNow complaining about the format of the Ui Script, just ignore the warning and accept it anyway.
Once that is done, you would be able to use the filter in your ng-repeat:
<div ng-repeat="contact in contactList | localeOrderBy:'FirstName'">
{{contact.FirstName}}
</div>
Hope that helps,
Nathan -
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-11-2019 03:27 PM
Hi Jerome,
The first thing you'll need to do is to create the filter as a dependency. If you go to the form view of the widget, you should see a "Dependencies" related list. From there you'll need to create the new dependency which ultimately is a UI Script containing the angular module (the first code block in your blog post).
You may get an error from ServiceNow complaining about the format of the Ui Script, just ignore the warning and accept it anyway.
Once that is done, you would be able to use the filter in your ng-repeat:
<div ng-repeat="contact in contactList | localeOrderBy:'FirstName'">
{{contact.FirstName}}
</div>
Hope that helps,
Nathan -