Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/81.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 为什么HTML代码的一部分消失了(AngularJS)?_Javascript_Html_Angularjs - Fatal编程技术网

Javascript 为什么HTML代码的一部分消失了(AngularJS)?

Javascript 为什么HTML代码的一部分消失了(AngularJS)?,javascript,html,angularjs,Javascript,Html,Angularjs,我在学AngularJS 我编写了以下代码: <ul class="list-group"> <li class="list-group-item" ng-repeat="product in store.products"> <h3 ng-include="'product-title.html'"/> <section ng-controller="PanelController as panel">

我在学AngularJS

我编写了以下代码:

<ul class="list-group">
    <li class="list-group-item" ng-repeat="product in store.products">
        <h3 ng-include="'product-title.html'"/>
        <section ng-controller="PanelController as panel">
            <ul class="nav nav-pills">
当我打开浏览器时,我看到
部分不存在于生成的HTML代码中

您可以找到整个源代码

如何解决此问题(使
部分出现在浏览器中)?

问题在您的解决方案中

<h3 ng-include="'product-title.html'"/>

ng include必须在此处所指的成对标签中使用-

所以就这样改变吧

<h3 ng-include="'product-title.html'"></h3>


在哪里关闭h3标签?如果HTML无效,难怪它不能正确呈现。通过验证器运行它。@Juhana
h3标记已正确关闭。IMHO.h3不是自动关闭标记。试着用一个合适的结束标记。@Juhana就是这样。请提交您的评论作为答复,我将接受。