I want to use the the jquery-globalize format function within a ng-bind to format a date value in a $scope field according to the current culture. Something like this:
<div>{{Globalize.format(test.testDate, Globalize.culture().calendar.patterns.d)}}</div>
But it doesn't seem to work.
How do I accomplish this the easiest way?
Thank you
Your question mentions
ng-bind
but I don't see any use of it in your code. In any event, you can always use a controller to bind a variable to you views.For example:
Then in your html you could do something like:
Or if you are using something like ui-router, you could do:
Note: If you are using
$scope
instead of thethis
method, it's basically the same process except you'll just trade thevm.
syntax with$scope.
and you can changeHomeController as homeCtrl
to justHomeController
.