angularjs怎么实现checkbox选中触发事件

angularjs怎么实现checkbox选中触发事件


BIG阳
浏览 1294回答 1
1回答

料青山看我应如是

html代码:<input type="checkbox" ng-click="sub(1)">选择<div ng-show="showType==1" class="btn"><button type="submit">提交申请</button></div><div ng-show="showType==2" class="btn"><button type="submit">提交申请</button></div>js代码:var app = angular.module('test', []);app.controller('chkCtrl', function($scope){$scope.showType=1;$scope.sub = function(type){if(type==1){$scope.showType =2;}else if( $scope.showType ==2){$scope.showType =1;}};这代码点击勾选的时候有效
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

AngularJS