blob: ea52778d0083f0e8b8e24b83a733547bab049c75 [file] [log] [blame]
module.exports = function iconInsideInputDirective() {
return {
restrict: 'A',
link: function(scope, element, attrs) {
// NOTE: this doesn't work on Chrome with auto-fill, known Chrome bug
element.css({
'background-repeat': 'no-repeat',
'background-position': '8px 8px',
'padding-left': '30px'
})
attrs.$observe('iconInsideInput', function(value) {
element.css({
'background-image': 'url(' + value + ')'
})
})
}
}
}