Skip to content

Instantly share code, notes, and snippets.

@squid314
squid314 / gist:e274b0fd320957484507
Last active August 29, 2015 14:01 — forked from thomseddon/gist:4703810
Placeholder polyfill > Updated to allow the *remote possibility* that the user wants the value of the input to exactly match the placeholder value.
angular.module('test', [])
.directive('placeholder', function($timeout){
var i = document.createElement('input');
if ('placeholder' in i) {
return {}
}
return {
link: function(scope, elm, attrs){
if (attrs.type === 'password') {
return;