New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

gulp-ng-templates

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gulp-ng-templates

Build all of your angular templates in just one js file using $templateCache provider

latest
Source
npmnpm
Version
1.0.2
Version published
Weekly downloads
782
-10.11%
Maintainers
1
Weekly downloads
 
Created
Source

gulp-ng-templates

Donate

Build all of your angular templates in just one js file using $templateCache provider

Installation

npm install --save-dev gulp-ng-templates
yarn add -D gulp-ng-templates

Example 1

var gulp = require('gulp');
var ngTemplates = require('gulp-ng-templates');

gulp.task('templates', ['clean'], function () {
	return gulp.src(paths.templates)
		.pipe(htmlmin({collapseWhitespace: true}))
		.pipe(ngTemplates({
			filename: 'templates.js',
			module: 'App/templates',
			path: function (path, base) {
				return path.replace(base, '').replace('/templates', '');
			}
		}))
		.pipe(gulp.dest('public/js'));
});

Example 2

var gulp = require('gulp');
var ngTemplates = require('gulp-ng-templates');

gulp.task('templates', ['clean'], function () {
	return gulp.src(paths.templates)
		.pipe(ngTemplates('moduleName'))
		.pipe(gulp.dest('public/js'));
});

API

gulp-ng-templates (options)

options

path - {function} [path=file.path, file.base]

Change the path of your templates. (See the example above)

If you not set this option it will automatically replace all of the file base path with nothing.

standalone - {boolean} (default: true)

Create a new AngularJS module, instead of using an existing one.

htmlMinifier - {object|boolean}

Options to pass to the html-minifier module

Defaults
{
	removeComments: true,
	collapseWhitespace: true,
	preserveLineBreaks: false,
	conservativeCollapse: false,
	collapseBooleanAttributes: true,
	collapseInlineTagWhitespace: true
}

module - {string} (default: templates)

Provides the module name.

header - {string}

The template header, the default value is:

angular.module("<%= module %>"<%= standalone %>).run(["$templateCache", function($templateCache) {

The template footer, the default value is:

}]);

Keywords

gulpplugin

FAQs

Package last updated on 14 Jan 2019

Did you know?

Socket

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