-
Notifications
You must be signed in to change notification settings - Fork 18
IIFE: Wrap #83
Copy link
Copy link
Open
Description
IIFE: Wrap AngularJS components in an Immediately Invoked Function Expression (IIFE).
CoffeeScript automatically wraps every file in to IIFE, this suggestion is not necessary while working with coffeescript
campaign_service.js.coffee
CampaignService = ->
{}
angular
.module 'dashboard'
.factory 'CampaignService', [
CampaignService
]
Will become:
campaign_service.js
(function() {
var CampaignService;
CampaignService = function() {
return {};
};
angular.module('dashboard').factory('CampaignService', [CampaignService]);
}).call(this);
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels