我正在使用 MEAN.js 生成器和我在网上找到的教程构建一个应用程序。在这里,我的一个 Angular 视图中有一个日期选择器。现在我希望 ng-change 指令被识别并做一些事情。在我更改日期时,此处显示的测试警报不会被调用。
<div class="form-group">
<label class="control-label" for="statusdate">Status Date</label>
<div class="controls">
<input type="date" ng-change="alert('something')" data-ng-model="statusDate" id="statusdate" class="form-control">
</div>
</div>
有人可以帮忙吗?我是 Angular 的新手。
另外,我在某处读到可能是因为我使用了 data-ng-model 而不是 ng-model。会是这样吗?如果是这样,那么两者之间有什么区别?