亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

angularjs怎么實現checkbox選中觸發事件

angularjs怎么實現checkbox選中觸發事件

BIG陽 2019-03-16 14:11:16
angularjs怎么實現checkbox選中觸發事件
查看完整描述

1 回答

?
料青山看我應如是

TA貢獻1772條經驗 獲得超8個贊

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;
}
};

這代碼點擊勾選的時候有效



查看完整回答
反對 回復 2019-03-25
  • 1 回答
  • 0 關注
  • 1265 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號