grunt-ng-classify
Convert CoffeeScript classes to AngularJS modules with ng-classify
Write less JavaScript. Write less CoffeeScript. Write less Angular.Watch the screencast
Install with npm
$ npm install grunt-ng-classify
module.exports = (grunt) ->
grunt.loadNpmTasks 'grunt-ng-classify'
grunt.initConfig
ngClassify:
app:
files: [
cwd: 'src'
src: '**/*.coffee'
dest: 'dest'
expand: true
]
options:
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: {
appName: 'app'
}
}
}
});
};
See the ng-classify docs
Optional
Type: Object
Default: undefined
see ng-classify API
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'};
}
}
}
}
});
};
See CONTRIBUTING.md
See CHANGELOG.md
See LICENSE