New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

ng-form-group

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ng-form-group

Automatic Bootstrap validation based on ngModel

  • 1.4.2
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
740
increased by0.14%
Maintainers
1
Weekly downloads
 
Created
Source

ngFormGroup

ngFormGroup applies Bootstrap validation classes based on ngModel's validity.

Installation

In your Angular project, run npm install --save ng-form-group if you're using npm, or bower install --save ng-form-group to save the module. Then, in your HTML, add:

<script src="/path/to/assets/ng-form-group/index.min.js"></script>

And lastly, in your Angular module, include ng-form-group as a dependency:

angular.module('my-app', ['ng-form-group')

Usage

Just mark up your form as recommended by Bootstrap and any fields with the class form-group will be automatically validated!

<form role="form">
  <div class="form-group">
    <label for="myEmail">Email address</label>
    <input type="email" ng-model="myEmailModel" class="form-control" id="myEmail">
  </div>
</form>

Now, when your model is invalided, by someone entering an invalid email address, the has-error class will be added to your form-group.

Validation in action

If you want to disable feedback for a specific form, add the form-group-without-feedback class to the form-group:

<form role="form">
  <div class="form-group form-group-without-feedback">
    <label for="search">Search for things:</label>
    <input type="search" ng-model="searchQuery" class="form-control" id="search">
  </div>
</form>

Bonus round: Feedback icons!

Just add the .has-feedback class to your form group, and we'll automatically add bootstrap style Feedback icons to your form fields.

Validation in action

Contributing

To get your dev environment up and running, run npm install and bower install to get the components we need.

Tests are run with npm run test and you can build the minified source with npm run build.

Releases are built using npm run release:[type]. So, to generate a new patch release, run npm run release:patch. This script will:

  • Generate minified, concatenated JS files,
  • Increment the version in package.json and bower.json
  • Tag a new release

FAQs

Package last updated on 20 Dec 2017

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

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc