I am looking to integrate the momentJs library into my TypeScript code for Date object operations. However, I need some guidance on how to inject TypeScript in AngularJS, as it differs slightly from JavaScript.
angular.module("app")
.config(function ($mdDateLocaleProvider) {
$mdDateLocaleProvider.formatDate = function (date) {
return moment(date).format('YYYY-MM-DD');
};
});
Even though I have included the CDN, the moment
function is not being recognized in the above code snippet.