Ionic: $scope for toggle issues


#1

I am currently construct a ionic app that I want to integrate toggle with. when a toggle is clicked, I want my app to send information over through a Bluetooth connection to another device. This is the code I have so far for the toggle controls:

[Controller $scope code]
.controller(‘MainCtrl’, function ($scope) {

$scope.$watch('Auto', function() {
	console.log('Auto Mode Changed');
	if($scope.Auto) {
		console.log('Auto mode activated!');
		app.automode();
	}
	else {
		app.autostop();
		console.log('Auto mode deactivated!');
	}
});
$scope.$watch('Note', function() {
	console.log('Notifications Mode Changed');
	if($scope.Note) {
		app.notemode();
		console.log('Notifications mode activated!');
	}
	else {
                   app.notestop();
		console.log('Notifications mode deactivated!');
	}
});

});
[/code]

That code is supposed to interact with these, defined in the index.html file of my program:

<ion-item class="item item-toggle"> AutoMode <label class="toggle toggle-calm"> <input type="checkbox" ng-model="Auto"> <div class="track"> <div class="handle"> </div> </div> </label> </ion-item> <ion-item class="item item-toggle"> Notification Mode <label class="toggle toggle-assertive"> <input type="checkbox" ng-model="Note"> <div class="track"> <div class="handle"> </div> </div> </label> </ion-item>
however, when I try to use them, nothing works. the toggles move, but the work that’s supposed to go behind them does nothing. I’m guessing that something in my controller code is wrong, but since i’m really new to this, I don’t quite get what.