grunt-ng-classify
Compile CoffeeScript classes to AngularJS modules
Last updated 6 years ago by carylandholt .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install grunt-ng-classify 
SYNC missed versions from official npm registry.

grunt-ng-classify

License Version Build Status Dependency Status

Convert CoffeeScript classes to AngularJS modules with ng-classify
Write less JavaScript. Write less CoffeeScript. Write less Angular.

Watch the screencast

Install

Install with npm

$ npm install grunt-ng-classify

Usage

CoffeeScript

module.exports = (grunt) ->
	grunt.loadNpmTasks 'grunt-ng-classify'

	grunt.initConfig
		ngClassify:
			app:
				files: [
					cwd: 'src'
					src: '**/*.coffee'
					dest: 'dest'
					expand: true
				]
				options:
					appName: 'app'

JavaScript

module.exports = function (grunt) {
	grunt.loadNpmTasks('grunt-ng-classify');

	grunt.initConfig({
		ngClassify: {
			app: {
				files: [
					{
						cwd: 'src',
						src: '**/*.coffee',
						dest: 'dest',
						expand: true
					}
				],
				options: {
					appName: 'app'
				}
			}
		}
	});
};

Table of Contents

API

See the ng-classify docs

options

Optional
Type: Object
Default: undefined
see ng-classify API

options.callback

Type: Function
Default: undefined

Dynamically creates options via the function callback. The function takes in the filePath and returns the options. Note: overrides other options

module.exports = (grunt) ->
	grunt.loadNpmTasks 'grunt-ng-classify'

	grunt.initConfig
		ngClassify:
			app:
				files: [
					cwd: 'src'
					src: '**/*.coffee'
					dest: 'dest'
					expand: true
				]
				options:
					callback: (filePath) ->
						return if filePath.indexOf('administrator') isnt -1
							{appName: 'admin'}

						{appName: 'app'}
module.exports = function (grunt) {
	grunt.loadNpmTasks('grunt-ng-classify');

	grunt.initConfig({
		ngClassify: {
			app: {
				files: [
					{
						cwd: 'src',
						src: '**/*.coffee',
						dest: 'dest',
						expand: true
					}
				],
				options: {
					callback: function (filePath) {
						if (filePath.indexOf('administrator') !== -1) {
							return {appName: 'admin'};
						}
						
						return {appName: 'app'};
					}
				}
			}
		}
	});
};

Contributing

See CONTRIBUTING.md

Changelog

See CHANGELOG.md

License

See LICENSE

Current Tags

  • 3.0.0                                ...           latest (6 years ago)

6 Versions

  • 3.0.0                                ...           6 years ago
  • 2.1.0                                ...           6 years ago
  • 2.0.0                                ...           6 years ago
  • 1.0.0                                ...           6 years ago
  • 0.5.1                                ...           6 years ago
  • 0.5.0                                ...           6 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (2)
Dev Dependencies (4)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |