Uncaught TypeError: Cannot read property 'filter' of undefined
code :
angular.module('PatientApp', []).filter('ageFilter', function() {
// birthday is a date
function calculateAge(birthday) {
var dateOut = new Date(birthday);
dateOut.setDate(dateOut.getDate() + 1);
var ageDifMs = Date.now() - dateOut .getTime();
// miliseconds from epoch
var ageDate = new Date(ageDifMs);
return Math.abs(ageDate.getUTCFullYear() - 1970);
}
return function(birthdate) {
return calculateAge(birthdate);
};
});
0 comments:
Post a Comment
Thanks