link
AngularJS H5 video src url
MVC,MVP 和 MVVM 的图示
ng-selected
<div ng-show="">
<select id="staffSiteId" ng-model="staffSiteId">
<option value="{{list.id}}"
ng-repeat="list in staffRoleList"
ng-selected="list.id==staffSiteId?true:false" >
{{list.name}}
</option>
</select>
</div>
ng-change 还没有输入完就执行方法
<input
ng-change="customerRecordSearchFreshCard()"
ng-model="customerWhereFreshCard">
问题: 在不到一秒的时间 再次输入,即再次调用
customerRecordSearchFreshCard 这个方法
解决方案:应用延时器,把customerRecordSearchFreshCard
里面要执行的部分放到延时器里面,
当你再次调用的时候,先取消掉你上一次的的延时器
----------
var timer_refresh_card;
$scope.customerRecordSearchFreshCard = function() {
clearTimeout(timer_refresh_card);
timer_refresh_card = setTimeout(function() {
if($scope.customerWhereFreshCard == "") {
return;
}
//你的操作
clearTimeout(timer_refresh_card);
}, 1000);
};