title: ng-model returning 'undefined' from directive
body: <p>I am trying to implement a system of reddit-like nested comments with reply fields hidden with <code>ng-show</code>. </p>
  
  <p>However when I attempt to return the comment from a custom directive into the controller, the result is always 'undefined'.</p>
  
  <p>I've followed this tutorial:</p>
  
  <blockquote>
    <p><a href="https://stackoverflow.com/questions/20097757/how-to-get-the-form-data-when-the-form-is-in-a-directive-in-angular">How to get the form data when the form is in a directive in Angular?</a></p>
  </blockquote>
  
  <p>but it's not working for me. </p>
  
  <pre><code>app.directive("replyContainer", function() {
      return {
          restrict: "E",
          scope: {
              onSubmit: "&amp;"
          },
          template: '&lt;a ng-click="replyForm = !replyForm"&gt;reply&lt;/a&gt;' +
            '&lt;div ng-show="replyForm" id="replyForm"&gt;' +
              '&lt;form ng-submit="submit()" ng-transclude'+
              'ng-show="isLoggedIn()"'+
              'style="margin-top:30px;"&gt;'+
                '&lt;h3&gt;Reply&lt;/h3&gt;'+
                '&lt;div class="form-group"&gt;'+
                  '&lt;input type="text" '+
                  'class="form-control"'+
                  'placeholder="Comment"'+
                  'parent="{{comment._id}}"'+
                  '&lt;script&gt;console.log(parent)&lt;/script&gt;'
                  'ng-model="model.Name"&gt;&lt;/input&gt;'+
                '&lt;/div&gt;'+
                '&lt;button ng-click="submit()"'+
                'class="btn btn-primary"&gt;Reply&lt;/button&gt;'+
              '&lt;/form&gt;'+
              '&lt;/div&gt;',
          transclude: true,
          link: function(scope, element, attributes) {
              scope.submit = function() {
                  scope.onSubmit();
              }
          }
  
      }
  })
  app.controller('PostsCtrl', ['$scope', 'posts', 'post', 'auth',
  function($scope, posts, post, auth) {
  
      $scope.model = {};
      $scope.submittedValue = null;
      $scope.post = post;
      $scope.isLoggedIn = auth.isLoggedIn;
      $scope.replyForm = false;
  
      $scope.addReply = function (){
          $scope.submittedValue = $scope.model.Name;
          console.log($scope.parent);
      };
  </code></pre>
  
  <p>index.ejs:</p>
  
  <pre><code>&lt;reply-container on-submit="addReply()"&gt;&lt;/reply-container&gt;
  </code></pre>