Closed alexg313 closed 8 years ago
<script src="lib/moment/min/moment.min.js"></script>
<script src="lib/angular-momentjs/angular-momentjs.js"></script>
<script src="lib/moment-duration-format/lib/moment-duration-format.js"></script>
importing files in this order (moment first, angular-momentjs second, moment-duration-format third) should do the trick!
My dev branch has better support for modules and exports an initializer function that allows you to setup moment-duration-format on any moment instance... could also help in this situation.
This may be a trivial issue, but it's giving me a hard time... How would I go about using moment-duration-format in my Angular controllers?
I've imported momentJS and MDF JS file in my index.html:
But when I call the below line in a controller, I get an error:
console.log( moment.duration(123, "minutes").format("h:mm") );
Error:
TypeError: moment.duration(...).format is not a function...