Is there a way to create a Start button that hides when clicked and shows a Stop button instead? When the Stop button is clicked, the Start button should reappear. I've attempted this but it doesn't seem to work. Any suggestions or ideas?
'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>
Is there a way to create a Start button that hides when clicked and shows a Stop button instead? When the Stop button is clicked, the Start button should reappear. I've attempted this but it doesn't seem to work. Any suggestions or ideas?