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

angular-shims-placeholder

Package Overview
Dependencies
Maintainers
2
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

angular-shims-placeholder

Angular directive to emulate the `placeholder` attribute on text and password input fields for old browsers, such as IE9, IE8, and below

  • 0.3.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.3K
decreased by-13.61%
Maintainers
2
Weekly downloads
 
Created
Source

angular-shims-placeholder

Angular directive to emulate the placeholder attribute on text and password input fields for old browsers, such as IE9, IE8, and below. Also works on textareas and html5 input types.

This directive works in both directions, which means that changing the value from inside the model is honoured in the form.

In comparison to https://github.com/urish/angular-placeholder-shim, this Angular directive is implementend purely on the AngularJS API and does not depend on other libraries, such as jQuery and jquery-html5-placeholder-shim.

View Demo

Build status

Build Status

Usage

Include

<script src="angular-shims-placeholder.min.js"></script>

into your application.

Add the module as a dependency to your application module:

angular.module('MyAwesomeApp', [/* other dependencies */, 'ng.shims.placeholder']);

That's it. Now, text fields having an attribute placeholder behave almost as native placeholder fields, even on IE8 and below.

Example:

<input type="text" name="email" placeholder="Enter your email" />

Note

Remember to adapt your styles for forms using this placeholder directive. To an empty input field, the class empty is added. So, when defining your styles, use a light grey, or similar, as text-color, to distinguish optically between labels and real input.

License

Released under the terms of MIT License.

Copyright (C) 2013, Jacob Rief jacob.rief@gmail.com

Keywords

FAQs

Package last updated on 03 Nov 2014

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