Reputation: 417
I have a very simple datepicker using AngularJS and I want to give it a placeholder to translate it using AngularJS translate (like I do usually in my project).
<div flex class="layout-row">
<md-datepicker ng-model="vm.calendarEvent.start" ng-model-options="{ timezone: 'UTC' }" md-placeholder="Une date" translate translate-md-placeholder="PROF.SHARE.DUE">
</md-datepicker>
</div>
Error: [$compile:multidir] Multiple directives [mdDatepicker (module: material.components.datepicker), translate (module: pascalprecht.translate)] asking for new/isolated scope on:
< md-datepicker class="ng-pristine ng-untouched ng-valid _md-datepicker-has-triangle-icon" ng-model="vm.calendarEvent.start" ng-model-options="{ timezone: 'UTC' }" md-placeholder="Une date" translate="" translate-md-placeholder="PROF.SHARE.DUE">
Upvotes: 6
Views: 995
Reputation: 18392
I think you are looking for this inline translation on md-placeholder
:
<div flex class="layout-row">
<md-datepicker ng-model="vm.calendarEvent.start"
ng-model-options="{ timezone: 'UTC' }"
md-placeholder="{{ 'PROF.SHARE.DUE' | translate }}">
</md-datepicker>
</div>
Upvotes: 3