-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
82 lines (77 loc) · 2.76 KB
/
index.html
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
78
79
80
81
82
<!DOCTYPE html>
<html lang="en" ng-app="app">
<head>
<meta charset="UTF-8">
<title>Angular Nutritionix Nutrition Label Demo</title>
<link rel="stylesheet" type="text/css"
href="./bower_components/nutrition-label-jquery-plugin/dist/css/nutritionLabel-min.css"/>
<script type="text/javascript" src="./bower_components/jquery/dist/jquery.min.js"></script>
<script type="text/javascript"
src="./bower_components/nutrition-label-jquery-plugin/dist/js/nutritionLabel-min.js"></script>
<script type="text/javascript" src="./bower_components/angular/angular.js"></script>
<script type="text/javascript" src="./angular-nutrition-label.js"></script>
</head>
<body ng-controller="index">
<h1>Nutrition Label Demo</h1>
<div nutrition-label="vm.labelData"
nutrition-label-options="{showDisclaimer: true, applyMathRounding: true}"
width="300"
></div>
<script type="text/javascript">
angular.module('app', ['nutritionix.nutrition-label'])
.controller('index', function ($scope) {
var vm = $scope.vm = this;
vm.labelData = {
allowFDARounding: false,
brandName: "Nutritionix",
decimalPlacesForQuantityTextbox: 2,
itemName: "cheeseburger",
scrollLongItemNamePixel: 38,
showAmountPerServing: true,
showCalcium: true,
showCalories: true,
showCholesterol: true,
showFatCalories: true,
showFibers: true,
showIngredients: false,
showIron: true,
showMonoFat: false,
showPolyFat: false,
showProteins: true,
showSatFat: true,
showServingSize: true,
showServingUnitQuantity: true,
showServingsPerContainer: false,
showSodium: true,
showSugars: true,
showTotalCarb: true,
showTotalFat: true,
showTransFat: true,
showVitaminA: true,
showVitaminC: true,
valueCalcium: 20.748,
valueCalories: 564.2,
valueCholesterol: 92.82,
valueFatCalories: 261.5886,
valueFibers: 3.094,
valueIron: 25.985555555555553,
valueProteins: 31.4678,
valueSatFat: 12.50886,
valueServingSizeUnit: "sandwich",
valueServingUnitQuantity: 1,
valueServingWeightGrams: 182,
valueSodium: 875.42,
valueSugars: 8.4994,
valueTotalCarb: 43.8074,
valueTotalFat: 29.0654,
valueTransFat: 1.13932,
valueVitaminA: 10.01,
valueVitaminC: 0,
userFunctionOnQuantityChange: function (description, previousValue, currentValue) {
console.log('quantity changed:', description, previousValue, currentValue);
}
};
});
</script>
</body>
</html>