/*  menu module */
app.service('MenuService', [function(){
	
}]);
app.controller('MenuController', ['$scope','$ionicSideMenuDelegate', 'MenuService',function($scope, $ionicSideMenuDelegate, menuS){
	$scope.menuItems = [
		{
			title: '主页',
			href: '#/app/home/main',
			selected: true
		},
		{
			title: '图标',
			href: '#/app/icon/main',
			selected: false
		},
		{
			title: 'List',
			href: '#/app/list/main',
			selected: false
		},
		{
			title: 'List-conllection',
			href: '#/app/list/collection',
			selected: false
		}
	];
	$scope.selectItem = function(item){
		$scope.unSelectAll();	
		item.selected = true;
	};
	$scope.unSelectAll = function(){
		for (var i = $scope.menuItems.length - 1; i >= 0; i--) {
			$scope.menuItems[i].selected = false;
		};
	};
	$scope.goSettingPage = function(){
		$scope.unSelectAll();
		$scope.goState("app.setting.main");
		$ionicSideMenuDelegate.toggleLeft(false);
	};
}]);