当我从浏览器检查器看到时,ngRepeat div被注释掉了 [英] ngRepeat div get commented out when i see from the browser inspector

查看:660
本文介绍了当我从浏览器检查器看到时,ngRepeat div被注释掉了的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我的html代码。但ngRepeat div在浏览器检查器中显示为

在此处输入图片说明

<

html ng-app="myApp">
<head>
<link rel="stylesheet" href="script/bootstrap.css">
<script src="script/tuto.js"></script>
<script type="text/javascript" src="script/angular.js"></script>
<script type="text/javascript" src="script/angular.min.js"></script>
<script type="text/javascript" src="script/bootstrap.js"></script>
<script type="text/javascript" src="script/bootstrap.min.js"></script>
<link rel="stylesheet" href="css/app.css">


<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">

<title>Insert title here</title>
</head>
<body style="padding: 50px"  ng-controller="ctrl">

    <div>



        <p>
            <input type="text" placeholder="Search..." ng-model="searchFor"
                size="20" />
        </p>


        <div class="album panel panel-primary" ng-repeat="album in albums">
            <div class="panel-heading">
                {{ album.title }}
                <div style="float: right">{{ album.date }}</div>
            </div>
            <div class="description">{{ album.description }}</div>
        </div>
    </div>

        <p>
            <input type="text" placeholder="Search..." ng-model="searchFor"
                size="20" />
        </p>


        <div class="album panel panel-primary" ng-repeat="album in albums">
            <div class="panel-heading">
                {{ album.title }}
                <div style="float: right">{{ album.date }}</div>
            </div>
            <div class="description">{{ album.description }}</div>
        </div>



        <h3>Add new Album</h3>

        <div class="album panel panel-success" ng-repeat="album in albums">
            <div class="panel-heading">
                {{ album.title }}
                <div style="float: right">{{ album.date }}</div>
            </div>
            <div class="description">{{ album.description }}</div>
        </div>





</body>
</html>

在此输入代码

这是HTML代码。它还有angularJs.s的脚本部分。但ngRepaet div在浏览器检查器中显示为

This is the HTML code.it's also have the script part for angularJs.but the ngRepaet div showed as commented in browser inspector

推荐答案

您应该在另一个文件中编写脚本并添加 ng-app
这里是plnkr
https://plnkr.co/edit/yvJGX52osH9eTJggexec?p=preview

You should write script in another file and add ng-app Here is plnkr https://plnkr.co/edit/yvJGX52osH9eTJggexec?p=preview

你的问题是你在angular.js上面包含文件脚本。包括以下内容,问题将解决

your problem is you include file script above angular.js . include below and problem will solved

    <link rel="stylesheet" href="script/bootstrap.css"> 
<script> type="text/javascript" src="script/angular.js"></script> 
<script> type="text/javascript" src="script/angular.min.js"></script> <script> type="text/javascript" src="script/bootstrap.js"></script>
 <script type="text/javascript" src="script/bootstrap.min.js"></script> 
<link rel="stylesheet" href="css/app.css">
 <script src="script/tuto.js"></script> //include below

这篇关于当我从浏览器检查器看到时,ngRepeat div被注释掉了的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆