Javascript 插入带有ng include的页面时未显示的注释

Javascript 插入带有ng include的页面时未显示的注释,javascript,angularjs,model-view-controller,Javascript,Angularjs,Model View Controller,当我作为一个单独的页面导航到showpost.html中时,showpost.html中的注释系统工作正常,但是当使用ng include将showpost.html包含在post.html中时,注释不会显示给我。有人看到我没有注意到的任何嵌套或范围问题吗 这些控制器位于app.js中,它没有检测到我在showpost.html//中登录,因为我注销时会显示注释文本区域。因此,ng show和ng hide所做的与我在包含页面时所期望的相反 posts.html <div class="u

当我作为一个单独的页面导航到showpost.html中时,showpost.html中的注释系统工作正常,但是当使用ng include将showpost.html包含在post.html中时,注释不会显示给我。有人看到我没有注意到的任何嵌套或范围问题吗

这些控制器位于app.js中,它没有检测到我在showpost.html//中登录,因为我注销时会显示注释文本区域。因此,ng show和ng hide所做的与我在包含页面时所期望的相反

posts.html

<div class="ui comments">
  <h3 class="ui dividing header">Latest posts</h3>

  <div class="comment" ng-repeat="post in posts">
    <a class="ui avatar image">
      <img src="/images/avatar/guy.jpg">
    </a>
    <div class="content">
      <a class="author"><a ng-href="#/users/{{ post.creatorUID }}"><b>{{ post.creator }}</b></a></span></a>
      <div class="metadata">
        <span class="date">Yesterday at 12:30AM</span>
      </div>
      <a ng-click="deletePost(post)" ng-show="user.uid === post.creatorUID" class="close-post"><i class="blue remove circle icon large"></i></a>
        <div>
            <a ng-href="{{ post.url }}">
            {{ post.title }}</a><br><br>
            <span class="url">{{ post.url | hostnameFromUrl }}</span>
            <br><br>
        </div>
      <div class="actions">
        <a class="reply" ng-href="#/posts/{{ post.$id }}">Add comment...</a>
      </div>
    </div><br>


<!-- COMMENTS NESTED -->

  <div ng-include src="'views/showpost.html'"></div>

<!-- COMMENTS NESTED -->

  </div>
</div>
<div class="container posts-page"> 
    <div ng-repeat="comment in comments" class="row cmt">
        <div class="col-md-12">
            <p>{{ comment.text }}</p>
            <p class="author">posted by <a ng-href="#/profile/{{ comment.creatorUID }}">{{ comment.creator }}</a>
            <a ng-href="#/posts/{{ post.$id }}" ng-click="deleteComment(comment, $index)" ng-show="signedIn() && comment.creatorUID === user.uid">(delete)</a></p>
        </div>
    </div>

    <div class="cmt-form">
        <div ng-hide="signedIn()">
            <p><a href="#/login">Sign in</a> to post a comment</p>
        </div>

        <form ng-show="signedIn()" ng-submit="addComment()">
            <textarea ng-model="commentText" placeholder="Post a Comment" class="form-control"></textarea><br />
            <input type="submit" value="Post Comment" class="btn btn-primary" />
        </form>
    </div>

</div>
/* global app:true */
/* exported app */
/* 'Firebase': false */

'use strict';

var app = angular
  .module('devNews', [
    'ngAnimate',
    'ngCookies',
    'ngResource',
    'ngRoute',
    'ngSanitize',
    'ngTouch',
    'firebase'
  ])

  .constant('FIREBASE_URL', 'https://sweltering-heat-8723.firebaseio.com/')

  .config(function ($routeProvider) {
    $routeProvider
      .when('/', {
        templateUrl: 'views/posts.html',
        controller: 'PostsCtrl'
      })
      .when('/posts/:postId', {
        templateUrl: 'views/showpost.html',
        controller: 'PostViewCtrl'
      })
      .when('/register', {
        templateUrl: 'views/register.html',
        controller: 'AuthCtrl',
        // Resolve authentication of user before redirecting
        resolve: {
          // Define user property to inject into controller
          user: function(Auth) {
            return Auth.resolveUser();
          }
        }
      })
      .when('/login', {
        templateUrl: 'views/login.html',
        controller: 'AuthCtrl', 
        resolve: {
          user: function(Auth) {
            return Auth.resolveUser();
          }
        }
      })
      .when('/users/:userId', {
        templateUrl: 'views/profile.html',
        controller: 'ProfileCtrl'
      })
      .otherwise({
        redirectTo: '/'
      });
  });