I have an ISO format moment created date formatted as a  datetime-local 
input  (   2016-05-02T00:38:41.181Z  )

comment.datetime = new moment();

comment.datetimeISO =comment.datetime.toISOString();

Neither of the  below lines work,  the first line gives no output., the 2nd 
causes an error starting after the 'h format part?

'<span style ="color:red" am-time-ago="comemnt.datetimeISO"> </span>'+
'{{ comment.datetimeISO | amDateFormat: 'h:mm a'}}'+


I am getting the dtformat error below. I read that you need to format moment  
as an ISOdate which I did.  It gets input intot the

mongodb as a string.  Is that changing the format or what?  Don't see why I 
should be getting a date format error.

Need to get these two lines to output.  What format do I need to give these two 
lines?  Why isn't it getting what it is expecting?


error: angular.js:11358 Error: [ngModel:datefmt] Expected 
`2016-05-02T00:55:26.809Z` to be a date 



-------directive-----


angular.module('commentList', ['comment','momentModule'])
  .directive('commentList', function () {

    return {
      template: '<div class="commentList">' +

                  '<comment-model ng-repeat="comment in comments" 
author="{{comment.author}}">' +
                      '{{comment.msg}}' +'&nbsp;'+'&nbsp;'+
                      '<span style="color:magenta">{{comment.datetimeISO 
}}</span>'+'&nbsp;'+'&nbsp;'+
                     '<span style ="color:red" 
am-time-ago="comment.datetimeISO"> </span>'+
  
                  '</comment-model>' +

                '<span ng-if="comments.length<1">No comments yet</span>' +
                 '</div>',

      restrict: 'E',
      scope: {
        comments: '='
      },
      link: function postLink(scope, element, attrs) {

      }
    };
  });


THANKS!

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to angular+unsubscr...@googlegroups.com.
To post to this group, send email to angular@googlegroups.com.
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to