replace new function pattern with IIFE and fixes errors in example code

This commit is contained in:
Keenan Lidral-Porter 2014-12-07 13:19:02 -08:00
parent 4d3430bf2b
commit e690134478
4 changed files with 14 additions and 14 deletions

View file

@ -136,7 +136,7 @@ myApp.users.index.view = function() {
There's no rule for how you should organize code, and given that namespacing is often achieved with simple javascript, you can use simple javascript patterns to alias a long namespace and reduce the amount of typing:
```javascript
new function() {
!function() {
var module = myApp.users.index = {}
module.vm = {/*...*/}
@ -148,7 +148,7 @@ new function() {
return vm.something
}
}
}()
```
---