>Where did you get that syntax from? There is no moment function that takes a date and a string - it's either a date OR a string (with an optional second string to inform on the format of the date in the first string). IAC all you need is :
$scope.currentData.age = moment().diff(newValue,"years");
Read the docs:
https://momentjs.com/docs/I don't know who wrote that syntax, but I did figure out exactly that on my own and I did read the docs (that's how I figured the needed change).
If it's not broken, fix it until it is.
My Blog