As you may know, the past few weeks have been spent with me working with Node and Express to re do this blog site of mine. And as you may know, part of writing a custom CMS (Content Management System) is writing an effective back end to create your content to be displayed on the site. Just as something different, I have decided that I use AngularJS to interact with my Express RESTful API.
Using $resource to handle the bulk of the data exchange, the Angular back end has come together really quickly. I am very happy with the progress thus far.
First thing I tried was to force a different output from Mongoose in the hopes that Angular would be able to parse the date if passed in a different format. This did not work.
Next I tried using one of Angular's filters to handle the data. But this produced the same error, that Angular could not parse the data time.
So after this, I evaluated the data coming back from express a little more closely. It turns out that Angular is not converting the date string into a date object to used. I had made the incorrect assumption that this would be handled automatically.
So what this allows for me to do, is to pass the date field into a new Date Object which Angular is then able to work with. Problem Solved!