Skip to content

Instantly share code, notes, and snippets.

@javaeeeee
Created December 16, 2016 23:10
Show Gist options
  • Select an option

  • Save javaeeeee/d26d4bb8236c91c24a643fd0dda8dc34 to your computer and use it in GitHub Desktop.

Select an option

Save javaeeeee/d26d4bb8236c91c24a643fd0dda8dc34 to your computer and use it in GitHub Desktop.
Using IIFE to remove AngularJS variables and methods from the global scope
(function () {
angular.module('app', [])
.controller('HelloController', HelloController);
HelloController.$inject = ['$scope'];
function HelloController($scope) {
$scope.myModel = 'World';
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment