Napoleonic Political Magnificence

npm

Bring the best of OSS JavaScript development to your projects with npm Orgs - private packages & team management tools.Learn more »

html-validate-angular

2.6.2 • Public • Published

html-validate-angular

pipeline status coverage report

AngularJS support for html-validate.

  • Extracts templates from components and routes with inline templates.
  • Transforms interpolated attributes (including ng-attr-*) in HTML.

Example

export const FooComponent = {
    template: "<button>foo</button>",
};
export function routeConfig($routeProvider) {
    $routeProvider.when("/route", { template: "<p>foo</i>" });
}

In both cases it will allow html-validate to parse and detect errors in the templates:

component.js
  2:13  error  Button is missing type attribute  button-type

route.js
  2:51  error  Mismatched close-tag, expected '</p>' but found '</i>'  close-order

Usage

npm install --save-dev html-validate-angular

In .htmlvalidate.json:

{
  "transform": {
    "^.*\\.js$": "html-validate-angular/js",
    "^.*\\.html$": "html-validate-angular/html"
  }
}

HTML processing is optional but is needed when attribute interpolation is used.

install

npm i html-validate-angular

Downloadsweekly downloads

84

version

2.6.2

license

MIT

homepage

gitlab.com

repository

Gitgitlab

last publish

collaborators

  • avatar
Report a vulnerability