Ionic saving the state of a checkbox

Hi everyone,
I was just wondering could anyone help me with this. I want to save the state of a checkbox after leaving the page and to be able to go back into that page and have the checkbox still checked. Any ideas?

//the page with the checkbox
’<'input type=“checkbox” ng-model="checked"
ng-init=“checked = CONFIG”>

//the controller of that page
.controller(‘chemicalEmergencyCtrl’, function($scope, $http) {
$scope.newTask = function() {
method: ‘GET’,
url: ‘’,
}).success(function(data) {
$scope.description = data;
.error(function(data) {
$scope.description = “No categories found by that name”;

$scope.CONFIG = localStorage.getItem('CONFIG');
	if (!$scope.CONFIG) {
	  $scope.CONFIG = true;

	$ = function(checked) {
	  $scope.CONGIF = checked;
	  localStorage.setItem('CONFIG', $scope.CONFIG);