Preparing for war – Getting the validation plugin

Like other plugins we could have installed, the installation and configuration steps are very similar. If this is the first time you are performing this operation, just carry out the following steps:

If you are using NPM as package manager, use this:

npm install aurelia-validation --save

Alternatively, if you are a JSPM user, use this:

jspm install aurelia-validation

Now, open your main.js file where we had configured our application plugins. In the configure() function, add the new plugin:

export function configure(aurelia) {
    aurelia.use
      .standardConfiguration()
      .developmentLogging()
      .plugin('aurelia-validation'); // <<-- Add this plugin!

Finally, open your aurelia.json file and add the following plugin declaration:

    {
      "name": "aurelia-validation",
      "path": "../node_modules/aurelia-validation/dist/amd",
      "main": "aurelia-validation"
    }

We are ready. Let's go!

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.222.196.175