Html View :
<input type="checkbox"
id="checkbox1"
class="make-switch"
ng-init="option=true"
ng-change="getInput(option)"
ng-model="option"
data-on-text=" Individual "
data-off-text=" Company " input >
Controller file :
$scope.getInput = function(option){
alert(option);
}
I am using the checkbox with make-switch class. It's not getting fired. The ng-change
directive is not affecting any changes.
只需在控制器中初始化选项变量,如下所示:
$scope.option = false;
angular.module('MetronicApp').controller('leadDetailsController', function($rootScope, $scope, $http, $timeout) {
$("[name='makeSwitch']").bootstrapSwitch();
$scope.select = true;
$scope.leadSelect = false;
$scope.option = false;
//Next Click
$scope.nextView = function(leadSelect){
$scope.select = false;
$scope.Individual = true;
}
$scope.getInput = function(option){
alert(option);
}
});
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.