forked from amohata007/Angular-cart
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Grocery.js
77 lines (65 loc) · 1.66 KB
/
Grocery.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
var app = angular.module('app',["ngRoute"]);
app.config(function($routeProvider){
$routeProvider
.when("/fruits",{
templateUrl: "Partials/fruit-list.html",
controller: "Ctrll"
})
.when("/cart",{
templateUrl: "Partials/cart-list.html",
})
.otherwise({
redirectTo: "/fruits"
});
});
app.controller('ctrl', function($scope){
$scope.title = 'GROCERY';
$scope.tagline = "All under one place.";
});
app.controller('Ctrll' , function($scope){
$scope.fruits= [
{
imgUrl: "mango.jpg",
name: "Mango",
Price: 50,
rating: 5,
brand: "Alphanso",
color: "yellow",
weigth: 20,
details: "There's only one reason why you love the great Indian summer: Mangoes!",
},
{
imgUrl: "lytchee.jpg",
name: "Lytchee",
Price: 150,
rating: 5,
brand: "Asian",
color: "Red",
weigth: 10,
details: "I'm right and you're wrong, I'm big and you're small, and there's nothing you can do about it.",
},
{
imgUrl: "cherry.jpg",
name: "Cherry",
Price: 250,
rating: 4,
brand: "African",
color: "Red",
weigth: 5,
details: " Life is just a bowl of cherries, so live and laugh and laugh at love, love a laugh, laugh and love. ",
},
{
imgUrl: "apple.jpg",
name: "Apple",
Price: 80,
rating: 4,
brand: "Kashmiri",
color: "Red",
weigth: 80,
details: "Anyone can count the seeds in an apple, but only God can count the number of apples in a seed",
},
]
});
// $scope.addToCart=function(fruit){
// console.log("Add to cart: ",books)
// }