ServiceNow Angular Directives LIST
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-10-2019 02:47 AM
Is there a list of all directive available like sp-date-picker and sn-record-picker ?
- Labels:
-
Service Portal
- 4,939 Views

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-10-2019 03:17 AM
did you try to check in Angular Providers module.
Service Portal > Angular Providers
for sn-record-picker.
https://YourInstanceID.service-now.com/scripts/sn/common/controls/directive.snRecordPicker.js
or you can refer the below url to get the details.
https://YOURINSTANCE.service-now.com/scripts/js_includes_sp.jsx

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-01-2019 10:25 AM
It would be nice if there were a page that listed the directives and an explanation of how to use them. Like API documentation.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-24-2020 04:07 PM
There is a reference guide for spUtil here if it helps.
https://serviceportal.io/sputil-cheat-sheet/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-01-2019 10:53 AM
There are exist no way to list all directives. You can see someone in Widget Angular Provider [sp_angular_provider] table, but the most other helpful directive you will find only in https://yourinctance.service-now.com/scripts/js_includes_sp.jsx directly. You need just open any page of Service Portal and open Developer Tools of Chrome. Choose file https://yourinstance.service-now.com/scripts/js_includes_sp.jsx and click on the Pretty Print {} button:
After that you will get pretty good and readable code, which include all directives, which can be used out-of-the-box. For example you can search for snRecordPicker, spDatePicker, snReferencePicker, spUtil and so on. Mostly one can search for the text like snRecordPicker.js or spUtil.js or for ".directive(", ".factory(", ".service(", to find the definition of the definition of the directive, factory or service.
You can copy the code and create your modified directive, which is based on the copy of existing directive.