Skip to content

Commit

Permalink
clarifieder how to use anon modules with rjs extension
Browse files Browse the repository at this point in the history
  • Loading branch information
tomconnors committed Aug 24, 2013
1 parent d3031f6 commit b9c5a87
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ Should you choose to use the .rjs extension, define modules like:
```
define(["dep1"], function(dep1){});
```
You can then access that module by its path, relative to the root of your app,
so if the module I just defined above were located at /client/views/pizza, I could
define a dependant module with:
```
define(["client/views/pizza"], function(pizza){ return !pizza; });
```

Only use `require` after you know a dep is already loaded.
```
Expand Down

0 comments on commit b9c5a87

Please sign in to comment.