如何获得单击时隐藏的开始按钮并显示停止按钮。当我单击停止按钮时,我想看到出现开始按钮。我试过了,但没有。有人有想法吗?
'use strict';
angular.module('djoro.controllers')
.controller('WifiSmartConfigCtrl', function($scope, $window, $ionicPlatform){
$scope.EventRunning = false;
$scope.showAlert = function(){
$ionicPlatform.ready(function(){
$window.cordova.plugins.Smartconfig.alert('My plugin works !');
});
};
$scope.startSmartconfig = function(){
var onSuccess = function(success){
$scope.StartEvent = function (event) {
event.preventDefault();
$scope.EventRunning = true;
};
};
var onFail = function(){};
$ionicPlatform.ready(function(){
$window.cordova.plugins.Smartconfig.startSmartconfig(onSuccess, onFail, wifiPassword);
});
};
$scope.stopSmartconfig = function(){
$ionicPlatform.ready(function(){
var onSuccess = function(){
$scope.StopEvent = function (event) {
event.preventDefault();
$scope.EventRunning = true;
};
alert("stopSmartconfig done");
};
var onFail = function(){};
$window.cordova.plugins.Smartconfig.stopSmartconfig(onSuccess, onFail);
});
};
)};
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.21/angular.min.js"></script>
<div class="startWifi">
<button ng-hide="EventRunning" class="button button-full button-balanced" ng-click="startSmartconfig($event)">Start</button>
<button ng-show="EventRunning" class="button button-full button-assertive" ng-click="stopSmartconfig($event)">Stop</button>
</div>
如何获得单击时隐藏的开始按钮并显示停止按钮。当我单击停止按钮时,我想看到出现开始按钮。我试过了,但没有。有人有想法吗?