angular-input-dropdown
angular-input-dropdown copied to clipboard
Add ng attr placeholder
Added a ng-attr-placeholder to the directive. I needed this to conditionally set placeholder content. I figured it'd be useful for others as well. Depends on #12
Hi,
I just had a look at this. What's the reason for using ng-attr-placeholder
instead of the normal placeholder
attribute? Thanks!
With ng-attr-placeholder you can dynamically set the value of a placeholder based on a condition. Here's an example:
<input ng-attr-placeholder="{{(form.item.$invalid && !form.item.$pristine) ? 'Required' : ''}}"/>
The above will set the input's placeholder to 'Required' when the form it's is submitted without that element filled in.