(function () { var serviceId = 'layoutService'; angular.module('app').factory('layoutService', [layoutService]); function layoutService() { //set the defaults var rightSideBar = false; var leftSideBar = true; var service = { getLeftSideBar: getLeftSideBar, setLeftSideBar: setLeftSideBar, getRightSideBar: getRightSideBar, setRightSideBar: setRightSideBar }; return service; function getLeftSideBar() { return leftSideBar; } function setLeftSideBar(bool) { leftSideBar = bool; } function getRightSideBar() { return rightSideBar; } function setRightSideBar(bool) { rightSideBar = bool; } } })();