IconService
The IconService is an Angular Factory in the SVG module with the name icon.js
. It provides an API to inject pre-installed icons (based on glyphs) to be used in the client-side application. To use this API, see the documentation on injecting Angular services.
What is an icon?
An icon is a higher level of abstraction for the GlyphService. It is used as a lookup for predefined glyphs to quickly create an SVG element. Icons are used in an HTML attribute in a directive to quickly insert dynamic icons into the GUI. There is also an API to quickly insert icons via the IconService instead of going through the GlyphService.
Icons are in the Device View. Below is a checkmark icon and a device switch icon as examples.
Notice how these are still SVG glyphs. The only difference is that they were inserted using the IconService via an icon directive.
API Functions
Name | Summary |
---|---|
loadIcon | Creates an icon with the given glyph ID. |
loadIconByClass | Create an icon with the given icon lookup. This function provides more options than loadEmbeddedIcon . |
loadEmbeddedIcon | Create an icon with the given icon lookup. |
addDeviceIcon | Adds a device icon to the given element. |
addHostIcon | Adds a host icon to the given element. |
iconConfig | Returns the configuration for device and host icons in the Topology View. |
sortIcons | Returns an API (used in Tabular views) for adding ascending and descending icons, and removing them. |
Function Descriptions
loadIcon
loadIconByClass
loadEmbeddedIcon
addDeviceIcon
addHostIcon
iconConfig
Returns the configuration for device and host icons in the Topology View .
Example Usage | Arguments | Return Value |
---|---|---|
is.iconConfig(); | none | an object with icon configuration information for device and host icons – access these through the tags 'device' and 'host' |
sortIcons