grunt-ngbs-forms
v2.5.0
Published
Generate forms using Angular for validations and Bootstrap for styles from short and concise descriptions of the fields.
Downloads
79
Maintainers
Readme
grunt-ngbs-forms
Generate forms using Angular for validations and Bootstrap for styles from short and concise descriptions of the fields.
To read more about the format of the form files see the ngbs-forms project directly.
Getting Started
This plugin requires Grunt ~0.4.2
If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:
npm install grunt-ngbs-forms --save-dev
Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
grunt.loadNpmTasks('grunt-ngbs-forms');
The "ngbs_forms" task
Overview
In your project's Gruntfile, add a section named ngbs_forms
to the data object passed into grunt.initConfig()
.
grunt.initConfig({
ngbs_forms: {
options: {
// Task-specific options go here.
},
your_target: {
// Target-specific file lists and/or options go here.
},
},
})
Options
options.formsCwd
Type: String
Default value: .
Folder where we should start searching the relative path to the form data.
Usage Examples
Default Options
This example uses the default options and generates the form(s) of testing.html saving the final result to default_options.html.
grunt.initConfig({
ngbs_forms: {
options: {},
files: {
'dest/default_options.html': ['src/testing.html'],
},
},
})
The testing.html file should have something like this:
...html before the form...
<%= buildForm('path/to/file.form.js') %>
...html after the form...
Contributing
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Grunt.