From cf39b3c3390bfc3a393e69b93b3b8ceb76efcdf9 Mon Sep 17 00:00:00 2001 From: Cary Landholt Date: Wed, 4 Sep 2013 10:05:39 -0500 Subject: [PATCH] Add IIFE to avoid introducing global variables Without the closure provided by the IIFE, angularLocalStorage is a global variable. The IIFE prevents global variable introduction. --- localStorageModule.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/localStorageModule.js b/localStorageModule.js index e74b0d0..4aee626 100644 --- a/localStorageModule.js +++ b/localStorageModule.js @@ -1,4 +1,4 @@ - +(function() { /* Start angularLocalStorage */ var angularLocalStorage = angular.module('LocalStorageModule', []); @@ -258,3 +258,4 @@ angularLocalStorage.service('localStorageService', [ }; }]); +}).call(this);