Tips and tricks

Using name-based dependency injection allows for conflicts between names. In order to avoid conflicts it may be worth prefacing your injected arguments with a special character. For instance, AngularJS uses the $ sign to denote an injected term.

Several times in this chapter I've mentioned the JavaScript build pipeline. It may seem odd that we have to build an interpreted language. However, there are certain optimizations and process improvements that may result from building JavaScript. There are a number of tools that can be used to help building JavaScript. Tools such as Grunt and Gulp are specifically designed to perform JavaScript and web tasks but you can also make use of traditional build tools such as Rake, Ant, or even ...

Get Mastering JavaScript Design Patterns - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.