Curious about why passing a simple variable as the parameter to the filter is not working:
Javascript:
let Test = Test || {};
Test.Constants = {};
Test.Constants.DateFormat = 'dd/MM/yyyy hh:mm';
function Main($scope){
$scope.date = new Date();
$scope.format = 'dd/MM/yyyy hh:mm';
$scope.format2 = Test.Constants.DateFormat;
}
HTML:
<div>
{{date}}<br> // "2016-06-13T10:29:49.935Z"
{{date | date: 'dd/MM/yyyy hh:mm'}}<br> // 13/06/2016 02:29
{{date | date: format}}<br> // 13/06/2016 02:29
{{date | date: format2}}<br> // 13/06/2016 02:29
{{date | date: Test.Constants.DateFormat}} // Jun 13, 2016
</div>
Any reason why the last one isn't properly formatted?
Appreciate any insights!