Reputation: 1007
I am trying to pass JSON string to md-datepicker directive as below:
md-date-locale="{ msgOpenCalendar: 'Open calendar for {{parameter.name}}' }"
md-date-locale attribute is rendered as:
md-date-locale="{ msgOpenCalendar: 'Open calendar for Start Date' }"
But, the aria-label for open calendar button as:
aria-label="Open calendar for {{parameter.name}}"
I need the aria-label to be rendered as 'Open calendar for Start Date'.
Can anyone please suggest? Or is it a bug in md-datepicker directive?
Upvotes: 1
Views: 159
Reputation: 6652
Instead of using double-curly braces in your view, do the concatenation in your controller instead:
$scope.msgOpenCalendarText = "Open calendar for Start Date " + $scope.parameter.name;
Then define your attribute like so:
md-date-locale="{ msgOpenCalendar: msgOpenCalendarText }"
Upvotes: 1