/
angularNgModel.js
26 lines (26 loc) · 1 KB
/
angularNgModel.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
(function ($, angular) {
var mod = angular.module('ng');
/*
* Angular does not use $.prop or $.attr for setting the attributes "selected" (radio/check boxes) and "checked"
* (select boxes). By this, we need to trigger the requestrefresh event ourselves.
* TODO use iAttrs.$observe for selected and checked and trigger a refresh on the widgets.
*/
mod.directive("ngModel", function () {
return {
restrict:'A',
require:'ngModel',
compile:function () {
return {
post:function (scope, iElement, iAttrs, ctrl) {
var _$render = ctrl.$render;
ctrl.$render = function () {
var res = _$render.apply(this, arguments);
iElement.jqmChanged(true);
return res;
};
}
}
}
}
});
})(window.jQuery, window.angular);