【发布时间】:2014-03-02 23:03:51
【问题描述】:
这些天我学习了 Angularjs,然后我使用在线 fiddle.net 编写了 angular.js 代码。一开始是因为 jsfiddle 不需要写 html 标签。所以我不知道应该把“ng-app”命令放在哪里。我分享的链接失效了,你有同样的问题吗? http://jsfiddle.net/liminjun88/Jh9K7/
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(index,1);
}
}
【问题讨论】: