-
Notifications
You must be signed in to change notification settings - Fork 2
/
repeat.js
31 lines (25 loc) · 830 Bytes
/
repeat.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
var Montage = require("montage").Montage,
ArrayController = require("montage/ui/controller/array-controller").ArrayController;
exports.Repeat = Montage.create(Montage, {
arrayController: {
value: null
},
didCreate: {
value: function () {
var content = ["a", "b", "c"];
this.arrayController = ArrayController.create().initWithContent(content);
}
},
handleChangeButtonAction: {
value: function (evt) {
var newContentCount = Math.floor(Math.random() * 11),
newContent = [],
i;
for (i = 0; i < newContentCount; i++) {
newContent.push(Math.random());
}
this.arrayController.content = newContent;
console.log(newContent);
}
}
});