bind mdpPlaceholder as '@'
Hi, I'd like to let my placeholder dynamic, so I can define it on my controller, like so:
$scope.customPlaceholder = 'My Date';
<mdp-date-picker
mdp-placeholder="{{customPlaceholder}}">
Is there a way to bind it?
As it's not a $scope, but an attribute only, I believe attributes.$observe will help to make it happen.
Cheers
I've edited the template
from:
'<input type="{{ ::type }}" aria-label="' + placeholder + '" placeholder="' + placeholder + '"' + (openOnClick ? ' ng-click="showPicker($event)" ' : '') + ' />' +
to
'<input type="{{ ::type }}" aria-label="{{placeholder}}" placeholder="{{placeholder}}"' + (openOnClick ? ' ng-click="showPicker($event)" ' : '') + ' />' +
It works just fine, but I found a bug on Angular Material while try to bind placeholder. It gets duplicate if you don't set md-no-float

I openned this issue https://github.com/angular/material/issues/8251
Seems that the problem with duplicate placeholder from Angular Material has been solved at 1.1.0-rc.5 version. I tested here and works fine. If you want I could provide a pull request changing the mdpDatePicker and updating angular material dependency at bower.json
Hi @marcomafessolli, thanks for that.
That would be awesome.
@leocaseiro I've created a pull request. Check it out: #127
Maybe this isn't going to be merged because it depends of a release candidate version of Angular Material. So, until then, you can download via bower from my forked repo using bower install marcomafessolli/mdPickers
Thanks for that @marcomafessolli. I think that should be merged with the next Material release. But yeah, I can definitely use for the time being.