-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtest.html
65 lines (46 loc) · 1.62 KB
/
test.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<script src="build/mini.min.js"></script>
</head>
<body>
<div id="test_app"> <p> my name is: {{name}}</p>
<h1> this works good mr. {{m_name}} </h1>
<button m-on:click="call_me" > test m-on:click </button>
<p m-for=" item in arr "> {{item}} </p>
<button m-on:click="update_array"> view update </button>
</div>
<!--<script src="./lex/lex.js"></script>-->
<!--<script src="./parser/parser.js"></script>-->
<!--<script src="./generator/generator.js"></script>-->
<!--<script src="main/main.js"></script>-->
<!--<script src="reactivity/reactive.js"></script>-->
<script>
var app = new Mini({
el: '#test_app',
data: {
name: 'rajat',
m_name: ' knight king',
arr: ['a', 'b', 'c'],
call_me: function () {
// alert(' hey m-on:click is working... yuppeeee ');
var $scope = this.$data;
console.log(' ths is data, ', arguments[arguments.length - 1], this.get('m_name'), this.$data.m_name, $scope.arr);
this.$data.m_name = 'you are no king';
$scope.arr.push('d');
console.log(' updated data: ', this.get('m_name'), $scope.m_name, $scope.arr);
},
update_array: function () {
var temp = this.get('arr');
temp.push('x');
console.log(' updating the array :: ', temp);
this.set('name', 'no name');
this.set('arr', temp);
}
}
});
</script>
</body>
</html>