Socket
Socket
Sign inDemoInstall

gulp-angular-htmlify

Package Overview
Dependencies
87
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    gulp-angular-htmlify

Change your ng-attributes to data-ng-attributes for html5 validation


Version published
Maintainers
1
Created

Readme

Source

gulp-angular-htmlify

Change your ng-attributes to data-ng-attributes for html5 validation

NPM Version NPM Downloads Dependencies Build Status

Ever tried to run an Angular html page into w3c validator? Yeah it's a mess.

The solution everyone recommends is to add data to all your ng directives. Now with gulp this can be easily made part of your build flow, similar to how ng-min is to creating minfiable Angular syntax.

Turn this:

<html ng-app="myApp">
...
<body ng-controller="MainCtrl">
</body>
</html>

Into this:

<html data-ng-app="myApp">
...
<body data-ng-controller="MainCtrl">
</body>
</html>
HTML5 Valid

Install

Install with npm

npm install --save-dev gulp-angular-htmlify

Example

var gulp = require('gulp');
var htmlify = require('gulp-angular-htmlify');

gulp.task('htmlify', function() {
    gulp.src('public/**/*.html')
        .pipe(htmlify())
        .pipe(gulp.dest('build/'));
});

API

htmlify(params)

params is an object that contains the following settings:

verbose

Type: Boolean

Whether to log files that had ng-directives detected and replaced. (Useful for debugging).

Defaults to false.

Example usage:

//...
.pipe(htmlify({
    verbose:true
    }))
// --> [gulp] Found and replaced ng-directives in index.html
//...

License

MIT ©2014 Gilad Peleg

Keywords

FAQs

Last updated on 04 Apr 2014

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc