动态添加的ng-model不起作用?

时间:2016-09-29 19:36:11

标签: angularjs dhtmlx

我正在使用dhtmlxScheduler和angular js。 我在复选框中插入了ng-model属性,并选择了dhtmlxScheduler的灯箱元素 - ng-model =" isallday"。

    link:function($scope, $element, $attrs, ...) {
    ...
    angular.element(document.querySelector( '[name="isallday"]' )).attr('ng-model', 'isallday');
    angular.element( document.querySelector( ".dhx_section_time" )
    .getElementsByTagName("select") ).attr('ng-class', '{dhx_time_disable: isallday}');

点击复选框不起作用。 我做错了什么?

1 个答案:

答案 0 :(得分:0)

ng-model是指令。但是你只是在你的元素中添加一个属性。角度不见。 看看Dynamically add directive in AngularJS