Angularjs 防止在网页上显示花括号

Angularjs 防止在网页上显示花括号,angularjs,Angularjs,一个帮助我熟悉AngularJS的简单程序,目前在标签中的代码有问题。每次我运行这段代码时,大括号和里面的内容总是出现在网页上,我如何防止这种情况发生 <head> <title> Your Shopping Cart </title> </head> <body ng-controller="CartController"> <h1> Your Order </h1> <div ng-repe

一个帮助我熟悉AngularJS的简单程序,目前在标签中的代码有问题。每次我运行这段代码时,大括号和里面的内容总是出现在网页上,我如何防止这种情况发生

<head>
    <title> Your Shopping Cart </title>
</head>

<body ng-controller="CartController">
<h1> Your Order </h1>

<div ng-repeat="item in items">

<input ng-model="item.quantity">
    *<span>{{item.title}}</span> //Keeps showing on webpage
    <span>{{item.price | currency}}</span> //Keeps showing on webpage
    <span>{{item.price * item.quantity | currency}}</span>* //Keeps showing on webpage
<button ng-click="remove($index)">Remove</button>

</div>

<script src="angular.min.js"> </script>

<script>
function CartController($scope) {$scope.items = [

    {title: 'Paint Pots', quantity: 8, price: 3.95},
    {title: 'Polka Dots', quantity: 17, price: 12.95},
    {title: 'Pebbles', quantity: 5, price: 6.95}
    ];

    scope.remove = function(index){$scope.items.splice(iindex, 1);
    }
}
</script>

</body>


你的购物车
您点的菜
*{{item.title}}//一直显示在网页上
{{item.price | currency}}//一直显示在网页上
{{item.price*item.quantity}}*//一直显示在网页上
去除
函数控制器($scope){$scope.items=[
{标题:“油漆罐”,数量:8个,价格:3.95},
{标题:'波尔卡圆点',数量:17,价格:12.95},
{标题:“鹅卵石”,数量:5,价格:6.95}
];
scope.remove=函数(索引){$scope.items.splice(iindex,1);
}
}

使用ng绑定或ng斗篷:

ng bind


使用
ng bind
进行工作:将您的角度库引用移动到head标记或body标记的顶部

<head>
    <title> Your Shopping Cart </title>
<script src="angular.min.js"> </script>
</head>

你的购物车



我使用了ng bind,我只看到教科书和标题。除此之外,没有其他的事情发生displayed@Robbie-请检查小提琴,它工作正常,如果有任何错误,请检查浏览器开发人员控制台检查控制台是否存在编译错误。Angular可能由于语法错误而崩溃。
<div ng-repeat="item in items" ng-cloak>
    <input ng-model="item.quantity">
    *<span>{{item.title}}</span> //Keeps showing on webpage
    <span>{{item.price | currency}}</span> //Keeps showing on webpage
    <span>{{item.price * item.quantity | currency}}</span>* //Keeps showing on webpage
    <button ng-click="remove($index)">Remove</button>
</div>
<head>
    <title> Your Shopping Cart </title>
<script src="angular.min.js"> </script>
</head>
<body>
<script src="angular.min.js"> </script>