ngChange不在模态内工作?

时间:2016-01-28 08:38:25

标签: angularjs

我有这种模式:

<!--Modal-->
<script type="text/ng-template" id="usernameModal.html">
    <div class="modal-header">
        <h3 class="modal-title">Welcome</h3>
    </div>
    <div class="modal-body">
        <div class="input-group">
            <span class="input-group-addon" id="basic-addon1"><span style="font-size: large;color:#d9534f;" class="glyphicon glyphicon-remove-sign"></span></span>
            <input ng-change="checkUsername()" ng-model="msg.name" type="text" class="form-control" placeholder="Username" aria-describedby="basic-addon1">
        </div>
    </div>
    <div class="modal-footer">
        <button ng-class="startButton" class="btn btn-success" type="button" ng-click="ok()">OK</button>
    </div>
</script>

我正试图在事情发生变化时发动事件,这是我的角度代码:

$scope.checkUsername = function () {
    alert("test");
};

ngKeydownngKeypressngKeyup也不起作用,有人知道这些指令是否被删除了吗?

编辑

this demo中,一切都完美地在模态之外。

0 个答案:

没有答案