-
Notifications
You must be signed in to change notification settings - Fork 1.9k
/
Copy pathangular.js
77 lines (55 loc) · 2.33 KB
/
angular.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
(function () {
module("NumericTextBox AngularJS integration", {
teardown: function() {
kendo.destroy(QUnit.fixture);
}
});
ngTest2("k-ng-model updates model on numerictextbox change", 1, function(dom, controller, bootstrap) {
$("<div><input kendo-numerictextbox='number' k-ng-model='value' /></div>")
.appendTo(dom);
controller(function($scope) {
$scope.value = 10;
});
bootstrap(); var $scope = dom.scope();
$scope.number.value(11);
$scope.number.trigger("change");
equal($scope.value, 11);
});
ngTest2("k-ng-model updates model on numerictextbox spin", 2, function(dom, controller, bootstrap) {
$("<div><input kendo-numerictextbox='number' k-ng-model='value' /></div>")
.appendTo(dom);
controller(function($scope) {
$scope.value = 10;
});
bootstrap(); var $scope = dom.scope();
$scope.number._upArrowEventHandler.notify("press");
equal($scope.number.value(), 11);
equal($scope.value, 11);
});
ngTest("ng-model updates model on numerictextbox change", 1, function() {
angular.module("kendo.tests").controller("main", function($scope) {
$scope.value = 10;
});
QUnit.fixture.html('<div ng-controller=main><input kendo-numeric-text-box="number" ng-model="value" /></div>');
},
function() {
var numerictextbox = QUnit.fixture.find("[data-role=numerictextbox]").getKendoNumericTextBox();
var scope = numerictextbox.element.scope();
numerictextbox.value(11);
numerictextbox.trigger("change");
equal(scope.value, 11);
});
ngTest("ng-model updates model on numerictextbox spin", 2, function() {
angular.module("kendo.tests").controller("main", function($scope) {
$scope.value = 10;
});
QUnit.fixture.html('<div ng-controller=main><input kendo-numeric-text-box="number" ng-model="value" /></div>');
},
function() {
var numerictextbox = QUnit.fixture.find("[data-role=numerictextbox]").getKendoNumericTextBox();
var scope = numerictextbox.element.scope();
numerictextbox._upArrowEventHandler.notify("press");
equal(numerictextbox.value(), 11);
equal(scope.value, 11);
});
})();