var Calculator = function () { service1 = function() {......} service2 = function() {......} return { myService1: service1, myService2: service2 } };You can define which members are publicly accessible and which members are private. This is done by adding a return statement at the end of the function that exposes the public members.
Source: http://weblogs.asp.net/dwahlin/techniques-strategies-and-patterns-for-structuring-javascript-code-revealing-module-pattern
No comments:
Post a Comment