Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

angular-charlimit

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

angular-charlimit

An angular directive to limit the number of characters in a bootstrap textbox

  • 0.1.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Angular Character Limit

This is my directive to limit the number of characters you can enter in a text field. It assumes you are using Bootstrap, and appends the warning class to your control-group at 10 characters left, and error at 0.

Use

You need to include the igCharLimit.js file before your app, but after angular.

This directive creates a new html attribute called char-limit. On your <input /> or <textarea></textarea> you put char-limit="x", where x is the number of characters you wish to limit the field to.

For example…

// Load the directive

// In your controller // Include the module in your app var ngMyApp = angular.module('myApp', ['igCharLimit']);

// In your markup

Requirements
  • Angularjs (Tested against 1.0.1 and later*)
  • jQuery
  • Bootstrap (This directive assumes you are using it, and assigns the warning, and error classes to your elemenets control-group div, but does not need Bootstrap to function.)
Todo
  • Remove dependency on jQuery
  • Remove assumption on Bootstrap

Keywords

FAQs

Package last updated on 23 Apr 2016

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