add a date field to a template and to the model

From: Janis Rough <janis.rough@xxxxxxxxx>
To: mongodb-user <mongodb-user@xxxxxxxxxxxxxxxx>
Date: Wed, 20 Apr 2016 16:28:23 -0700 (PDT)
Why ads?
I have to add a date field to this angular app that lists comments.  It 
only has the 3 fields.    All I need is the current date to do some date 
calculations with   I have no idea what is happening.  I know MySQL but not 
mongo db.  There is a config.json file that has the backend data so I added 
the field see the json file.  I want it to be a auto enter date field but I 
can't even get a regular <input>  date to show up in the commentsform

I'm not getting any errors but just that the comment.date doesn't display on this template.  Its pretty

simple structure.  Does it look like I added the model  right to the comment.date?  Should be easy.

Also, I include the template.  Can you let me know what to look for? I get success in the console.log.


/**
 * @ngdoc directive
 * @name angularApp.directive:commentForm
 * @description
 * # commentForm
 */
angular.module('commentForm', [])
  .directive('commentForm', function () {


    return {
      template: '<form class="commentForm" name="form">' +
                  '<input type="text" placeholder="Your name" ng-model="comment.author" name="author"/>' +
                  '<input type="text" placeholder="Say something..." ng-model="comment.msg" name="msg"/>' +

                   '<input type="date" ng-model="comment.date" name="date"/>' +
                  '<input type="submit" value="Post" ng-click="submitComment()"/>' +

                '</form>',
      restrict: 'E',

      link: function postLink(scope, element, attrs) {
        scope.comment = {};
        scope.submitComment = function(){
          var comment = scope.comment;
          if (!comment.msg || !comment.author) {
            return;
          }
          scope.$emit('submitted', comment);
          scope.comment = {};
        }
      }
    };
  })


/**
 * @ngdoc directive
 * @name angularApp.directive:commentList
 * @description
 * # commentList
 */
angular.module('commentList', ['comment'])
  .directive('commentList', function () {
    return {
      template: '<div class="commentList">' +
                  '<comment-model ng-repeat="comment in comments" author="{{comment.author}}">' +
                    '{{comment.msg}}' +
                    '{{comment.date}}' +
                    '</comment-model>' +
                  '<span ng-if="comments.length < 1">No comments yet</span>' +
                '</div>',
      restrict: 'E',
      scope: {
        comments: '='
      },
      link: function postLink(scope, element, attrs) {}
    };
  });




------


{
   "type": "Collection",
   "properties": {
      "author": {
         "name": "author",
         "type": "string",
         "typeLabel": "string",
         "required": true,
         "id": "author",
         "order": 0
      },
      "msg": {
         "name": "msg",
         "type": "string",
         "typeLabel": "string",
         "required": true,
         "id": "msg",
         "order": 1
      },
      "date": {
         "name": "date",
         "type": "date",
         "typeLabel": "string",
         "required": false,
         "id": "date",
         "order": 2
      }
   }
}



I can give you the whole thing if you need it.  Its pretty simple.  There is a comment

-- 
You received this message because you are subscribed to the Google Groups "mongodb-user"
group.

For other MongoDB technical support options, see: https://docs.mongodb.org/manual/support/
--- 
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user+unsubscribe@xxxxxxxxxxxxxxxx.
To post to this group, send email to mongodb-user@xxxxxxxxxxxxxxxx.
Visit this group at https://groups.google.com/group/mongodb-user.
To view this discussion on the web visit https://groups.google.com/d/msgid/mongodb-user/4b78fa28-95ce-4786-8fd8-69ee0869132f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Why ads?