sn_angular Project Started

After spending more time than I should have researching any out of box Angular directives that could be usable in custom pages I turned up not much.  There are some for the mobile interface but they are not created in a way that would be easily reusable.  I was also not sure if that would be changing so it would be a pretty unstable place to start.

Rather than wait I am starting my own project to recreate as much of the ServiceNow OOB features as Angular modules.

The project is located on github:

It is also dependent on an earlier gist until I can merge everything into a single Update Set.


Recreating The Form

The first step is to get a reliable model of the form fields.  Just using GlideRecord would not return enough information.  Remember we need all the attributes for a field, such as: type, mandatory, read only, length and so on.  This will allow us to create a fully functional form without having to do any custom coding.

To address this I have started ngGlideRecord which is meant to be a client callable Script Include which exposes a get function (meant to be like GlideRecord get) that returns a record with each fields full attributes.  For forms this will make it very easy to just iterate over the fields and output them immediately having access to all the attributes.

I also created a simple test UI Page that includes the core files and does a get for an Incident record (you’ll need to change the sys id if you try to recreate this test page).

The test page (which will eventually become a boilerplat and the Form Directive) has a simple switch to output the variable as an input text field if it is of type String.  The rest will just output the variable value.

Each type will eventually have a directive which recreates the standard ServiceNow functionality.

Be sure to watch the repository on github and check back here to get the latest.

Join the Conversation


  1. This is really awesome.

    I believe the use of Esprima for just parsing a bit of it might have performance implications.

    Ideally, I would use Esprima for creating an AST for better purposes. See my Jello here:

    May be you can use a tinier library?

    1. I’m not sure if you are welcome to pulls, but if you are I would like to submit a pull after working on this for bit.

Leave a comment

Your email address will not be published. Required fields are marked *