首页 > 其他 > 详细

angular-ui-switch

时间:2017-08-08 14:40:15      阅读:110      评论:0      收藏:0      [点我收藏+]

代码:https://codepen.io/anon/pen/gxmWzB

github: https://github.com/xpepermint/angular-ui-switch

功能类似于bootstrap的switch功能,由于数据绑定的存在,不使用对象中的方法切换,改用watch监听model绑定的值(示例中的enabled),

  状态切换触发的函数在监听器中实现

var viewTypeWatcher = $scope.$watch(‘enabled‘,function(newValue,oldValue,scope){
         if(newValue === true&&typeof newValue != ‘undefined‘){
             $scope.getPersonList(2,0);
         }else if(newValue === false&&typeof newValue != ‘undefined‘){
             $scope.personReach(2,0)
         }
     })

 

angular-ui-switch

原文:http://www.cnblogs.com/insight0912/p/7306336.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!