Adding a library using JSPM is only a matter of running the proper command:
> jspm install aurelia-validation
This command will install the aurelia-validation
library to the project. Since JSPM has been designed to work with SystemJS, it will also add the proper entries to the SystemJS mapping configuration, which is found in the config.js
file and is used by SystemJS to map module names to URLs or local paths.
Once this command completes, the SystemJS module loader will be able to locate aurelia-validation
and its dependencies, if any, so you can start using it right away in your application.
Using a library in a JSPM-based application is similar to a CLI-based project. If you need to use some of the library's JS exports, simply import them in a JS file:
import {ValidationController} from 'aurelia-validation';
If you want to import other resources, like CSS files, simply require
it in the proper template:
<require from="bootstrap/css/bootstrap.css"></require>