Filters
This topic provides information about the various filters that you can use while developing widgets.
Default Angular Filters
Overview
Angular filters are utilized to format data before it is displayed on the UI. They can transform data of different types, such as strings, numbers, and dates. Angular offers a variety of built-in filters, and you can also create custom filters.
To use a filter, you must inject it into your controller. Then, you can apply it in an expression or directive by using the pipe character (|).
Reference: filter
Decode URI Filter
Overview
The Decode URI filter retrieves the UUID from the IRI:$filter('getEndPathName')(iri)
IRI: /api/3/alerts/80addd07-8636-42b0-bb87-e1817f01c48
Result: 80addd07-8636-42b0-bb87-e1817f01c48
Get Module Type Filter
Overview
The Get Module Type filter retrieves the module type from the IRI:$filter('getModuleTypeOfIri')(iri)
IRI: /api/3/alerts/80addd07-8636-42b0-bb87-e1817f01c48
Result: alerts
Valid IRI Filter
Overview
The Valid IRI filter checks the validity of the IRI:$filter('isValidIRI')(iri)
IRI: /api/3/alerts/80addd07-8636-42b0-bb87-e1817f01c48
Result: true
Truncate Text Filter
Overview
The Truncate Text filter truncates the text when its length exceeds 55 characters:{{'This is sample test' | truncateText}}
Result: This is sample...