码迷,mamicode.com
首页 > 其他好文 > 详细

angular-ui-switch

时间:2017-08-08 15:22:37      阅读:155      评论:0      收藏:0      [点我收藏+]

标签:new   efi   github   $scope   cti   tps   person   list   false   

代码: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

标签:new   efi   github   $scope   cti   tps   person   list   false   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!