표시된 입력 요소가 포커스를 잃을 때 각도 지시문에서 입력 요소에 추가하는이 변경 이벤트가 시작되지 않는 이유는 무엇입니까?입력에서 이벤트가 각도 지시문에서 실행되지 않음을 변경하십시오.
업데이트 : jqlite docs say - "jQuery가 지원하는 작업의 하위 집합입니다."... 그리고 이벤트 처리기 아래에 특별히 .change
이 나열되어 있습니다. 현재의 답변은 이와 모순됩니다. 저자가 "문서가 잘못되었습니다"또는 "문서에 대한 이해가 잘못됨"이라고 명시 적으로 말하고 싶습니다. 현재 그들은 처음 몇 줄을 건너 뛰고 더 이상 지나간 것처럼 보입니다. 아무도 내가 실제로 잡히지 않은 또 다른 실수가 있고 쉽게 다시 만들 수있을 때 다른 방식을 채택하면 배웁니다.
app.directive('changeDirective', function() {
return {
link: function(scope, elem, attrs) {
return elem.change(function() {
alert("Change!");
});
}
};
});
<html ng-app="plunker">
<head>
<script data-require="[email protected]" src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.17/angular.min.js" data-semver="1.2.17"></script>
<script src="app.js"></script>
</head>
<body>
input with change listener<input type="text" change-directive="true">
<br/>
select this to remove focus from other input <input type="number">
</body>
</html>
내 업데이 트를 참조하십시오. 이 함수 목록은 jqLite 문서와 다릅니다. 그것들은 일치하지 않습니까? https://code.google.com/p/jqlite/wiki/UsingJQLite – iftheshoefritz