angular学习日志04 购物车!
来源:互联网 发布:中国馆建筑 知乎 编辑:程序博客网 时间:2024/06/05 14:30
<!DOCTYPE html>
<html lang="en" ng-app="start">
<head>
<meta charset="UTF-8">
<title>shoppingcart</title>
<script type="text/javascript" src="js/angular.min.js"></script>
</head>
<body ng-controller='CartController'>
<h1>yourOrder</h1>
<div ng-repeat='item in items'>
<span>{{item.title}}</span>
<input ng-model='item.quantity'/>
<span>{{item.price|currency}}</span>
<span>{{item.price*item.quantity|currency}}</span>
<button ng-click="remove($index)">remove</button>
</div>
<script type="text/javascript">
angular.module("start",[])
.controller('CartController',function($scope){
$scope.items=[
{title:'Paint pots',quantity:8,price:3.95},
{title:'polka',quantity:17,price:13.95},
{title:'Ppebbles',quantity:8,price:6.95}
];
$scope.remove=function(index){
$scope.items.splice(index,1);
}
})
</script>
</body>
</html>
<html lang="en" ng-app="start">
<head>
<meta charset="UTF-8">
<title>shoppingcart</title>
<script type="text/javascript" src="js/angular.min.js"></script>
</head>
<body ng-controller='CartController'>
<h1>yourOrder</h1>
<div ng-repeat='item in items'>
<span>{{item.title}}</span>
<input ng-model='item.quantity'/>
<span>{{item.price|currency}}</span>
<span>{{item.price*item.quantity|currency}}</span>
<button ng-click="remove($index)">remove</button>
</div>
<script type="text/javascript">
angular.module("start",[])
.controller('CartController',function($scope){
$scope.items=[
{title:'Paint pots',quantity:8,price:3.95},
{title:'polka',quantity:17,price:13.95},
{title:'Ppebbles',quantity:8,price:6.95}
];
$scope.remove=function(index){
$scope.items.splice(index,1);
}
})
</script>
</body>
</html>
0 0
- angular学习日志04 购物车!
- Angular购物车示例
- Angular购物车
- angular.js 购物车
- Angular实现购物车
- angular购物车demo
- Angular实现购物车
- angular制作购物车
- angular实现购物车
- angular/html/购物车
- angular购物车路由
- 购物车angular
- Angular购物车
- angular购物车结算
- angular.js 购物车
- Angular 购物车
- 框架学习---1、angular简易demo~~购物车
- angular学习日志02
- Spring结合java Quartz配置实例代码
- OC面试中,Block常出现的三个问题
- <一>认识
- 利用正则表达式去除字符串中的空格
- java S2SH项目框架整合搭建实例教程
- angular学习日志04 购物车!
- python+opencv cv2.VideoCapture获取视频失败 解决方法
- linux编译ffmpeg2.8.4
- Activity的三种状态和生命周期的七种方法
- SSM框架——详细整合教程(Spring+SpringMVC+MyBatis)
- centos
- leetcode刷题日记——Summary Ranges
- 3555: [Ctsc2014]企鹅QQ
- WIN10通用,任重而道远!