角度模板的ng-include指令

时间:2017-05-22 19:35:38

标签: angularjs

在我的index.html代码中是:

我已将ng-include指令编写为

我的menu.html文件是

 <div class="container">
    <div class="row row-content" ng-controller="MenuController">
        <div class="col-xs-12">
        <button ng-click="toggleDetails()" class="btn btn-xs btn-primary pull-right" type="button">
           {{showDetails ? 'Hide Details':'Show Details'}}
        </button> 
         <ul class="nav nav-tabs" role="tablist">
                <li role="presentation"
                 ng-class="{active:isSelected(1)}">
                <a ng-click="select(1)"
                 aria-controls="all menu"
                 role="tab">The Menu</a></li>
                <li role="presentation"
                 ng-class="{active:isSelected(2)}">
                <a ng-click="select(2)"
                 aria-controls="appetizers"
                 role="tab">Appetizers</a></li>
                <li role="presentation"
                 ng-class="{active:isSelected(3)}">
                <a ng-click="select(3)"
                 aria-controls="mains"
                 role="tab">Mains</a></li>
                <li role="presentation"
                 ng-class="{active:isSelected(4)}">
                <a ng-click="select(4)"
                 aria-controls="desserts"
                 role="tab">Desserts</a></li>
            </ul>
        <div class="tab-content">
         <ul class="media tab-pane fade in active">
                <li class="media" ng-repeat = "dish in dishes  | filter:filtText">
                    <div class="media-left media-middle">
                    <a href="#">
                    <img class="media-object img-thumbnail"
                     ng-src={{dish.image}} alt="Uthappizza">
                    </a>
                    </div>
                <div class="media-body">
                    <h2 class="media-heading">{{dish.name}}
                     <span class="label label-danger">{{dish.label}}</span>
                     <span class="badge">{{dish.price | currency}}</span></h2>
                    <p ng-show="showDetails">{{dish.description}}</p>
                </div>
                </li>
            </ul>
        </div>  
        </div>
    </div>
</div>

但我无法从ng-include指令获得预期结果,并且在任何浏览器中打开它后,我无法在index.html文件中看到menu.html输出。

0 个答案:

没有答案