<!DOCTYPE html>
<html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<style>
/*展示数据每行变色*/
.css1 {
background-color: #00ff99;
}
.css2 {
background-color: #ff3399;
}
</style>
<script src="../libs/angular.js"></script>
<script src="../libs/jquery-1.11.0.min.js"></script>
<script>
var App = angular.module("myApp", []);
App.controller("myCtrl", function($scope) {
$scope.shops = [{
gid: 001,
gname: "手机",
gnum: 3,
gprice: 1000,
gcount: 3000
}, {
gid: 002,
gname: "电脑",
gnum: 3,
gprice: 2000,
gcount: 6000
}, {
gid: 003,
gname: "电视",
gnum: 6,
gprice: 500,
gcount: 3000
}];
//总价
$scope.totalPrice = function() {
var totalPrice = 0;
for(var x = 0; x < $scope.shops.length; x++) {
totalPrice += $scope.shop
<meta charset="UTF-8">
<title></title>
<style>
/*展示数据每行变色*/
.css1 {
background-color: #00ff99;
}
.css2 {
background-color: #ff3399;
}
</style>
<script src="../libs/angular.js"></script>
<script src="../libs/jquery-1.11.0.min.js"></script>
<script>
var App = angular.module("myApp", []);
App.controller("myCtrl", function($scope) {
$scope.shops = [{
gid: 001,
gname: "手机",
gnum: 3,
gprice: 1000,
gcount: 3000
}, {
gid: 002,
gname: "电脑",
gnum: 3,
gprice: 2000,
gcount: 6000
}, {
gid: 003,
gname: "电视",
gnum: 6,
gprice: 500,
gcount: 3000
}];
//总价
$scope.totalPrice = function() {
var totalPrice = 0;
for(var x = 0; x < $scope.shops.length; x++) {
totalPrice += $scope.shop