Developer Docs

Custom JavaScript Library with SpringBot

SpringBot uses Angular as its client-side framework, which in turn makes use of NodeJS and yarn. Dependencies can be added to Angular project via package.json, which is a configuration file that informs yarn what and how to install packages.

The following steps will walk through using the charting library chart.js within SpringBot.

  1. Open the package.json file located at clientside/package.json
  2. Locate the following code block and turn on the protected region by replacing off begin with on begin

     "//": [
       " protected region % [Add custom dependencies here] off begin "
      ],
    
  3. Add these lines below the code block

     "chart.js": "~2.8.0",
    

    Your protected region should now look like the following,

     "//": [
                  " protected region % [Add custom dependencies here] on begin "
              ],
              "chart.js": "~2.8.0",
              "//": [
                  " protected region % [Add custom dependencies here] end "
              ]
    

The supplied version number for chart.js is the most recent version at time of writing.. Your versions may vary.

  1. Open a new terminal and navigate to clientside.
  2. Run yarn install.

    You are now able to use chart.js in your application code.

On this page