-
Notifications
You must be signed in to change notification settings - Fork 0
/
calculator.html
80 lines (77 loc) · 3.53 KB
/
calculator.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
<!DOCTYPE html>
<html>
<head>
<title></title>
<link rel="stylesheet" href="styles.css" />
</head>
<body>
<script type="text/x-handlebars" data-template-name="application">
{{outlet}}
</script>
<!-- this template index will look for IndexController -->
<script type="text/x-handlebars" data-template-name="index">
<hr> {{partial 'calculator'}}
</script>
<script type="text/x-handlebars" data-template-name="_calculator">
<h1>Calculator!</h1>
{{#view 'App.CalculatorView'}}
{{#each item in model.displayInput}}
{{#view App.DisplayView itemBinding="item" model=model.displayInput value=item.inputText class=item.className}}
{{/view}}
{{/each}}
<!--this renders the number/operator buttons with data template name-->
<!-- {{render "numberBtns" model.numberBtn}}
{{render "operatorBtns" model.operatorBtn}} -->
<!-- TODO how to specific the class from here-->
<!--here display buttons using view-->
{{#each item in model.numberBtn}}
{{#view App.NumberBtnView itemBinding="item" name=item.type }}
{{view.item.value}}
{{/view}}
{{/each}}
{{#each item in model.operatorBtn}}
{{#view App.OperatorBtnView itemBinding="item" name=item.type}}
{{view.item.value}}
{{/view}}
{{/each}}
{{/view}}
</script>
<script type="text/x-handlebars" data-template-name="_display">
{{#view 'App.DisplayView' }}{{/view}}
</script>
<script type="text/x-handlebars" data-template-name="_button">
{{#view 'App.ButtonView'}}hel{{/view}}
</script>
<script type="text/x-handlebars" data-template-name="operatorBtns">
{{#each item in model}}
<button {{bind-attr class="item.className" }}>{{item.value}}</button>
{{/each}}
</script>
<script type="text/x-handlebars" data-template-name="numberBtns">
{{#each item in model}}
<button {{bind-attr class="item.className" style="item.style" }}>{{item.value}}</button>
{{/each}}
</script>
<script type="text/javascript" src="libs/jquery-2.1.3.min.js"></script>
<script type="text/javascript" src="libs/ember.debug.js"></script>
<script type="text/javascript" src="libs/ember-data.js"></script>
<script type="text/javascript" src="libs/ember-template-compiler.js"></script>
<script type="text/javascript" src="libs/handlebars-v3.0.0.js"></script>
<script type="text/javascript" src="calculator.js"></script>
<script src="views/CalculatorView.js"></script>
<script src="views/DisplayView.js"></script>
<script src="views/ButtonView.js"></script>
<script src="views/NumberBtnView.js"></script>
<script src="views/OperatorBtnView.js"></script>
<script src="models/CalculatorModel.js"></script>
<script src="models/DisplayModel.js"></script>
<script src="models/ButtonModel.js"></script>
<script src="models/NumberBtnModel.js"></script>
<script src="models/OperatorBtnModel.js"></script>
<script src="controllers/OperatorBtnsController.js"></script>
<script src="controllers/NumberBtnsController.js"></script>
<script src="controllers/CalculatorsController.js"></script>
<script src="controllers/DisplayController.js"></script>
<script src="controllers/ButtonController.js"></script>
</body>
</html>