Angular application with modules, bundles, require.js and r.js
Installing dependencies
npm install
Running server
Processed by rjs node public/server.js
Development mode node public/server.js
To build project (compile it into bundles, minify CSS, copy to public folder and other cool things, that you can set up in build.js) type this into your shell (navigate to project folder)
r.js.cmd -o build.js
r.js -o build.js
Your build is located in public folder.
index.html is an entry point.
- Place module folder into
js/componentsfolder. It must be a requirejs package, withmain.jsfile in it, which contains a list of all module files. In this examplemodule.jsis an entry point of module, where stored module configuration and angular dependencies - Add a new package into
js/main.jsfile, atpackagesobject, with it's own name and location. - Create new bundle or add package name to one of existing bundles (like
mymoduleadded toappbundle). Bundle can be a set of modules/packages. - Add to
appmodule angular dependency, with name of your angular module.
- Create a new file with desired bundle name in
js/bundlesand list all packages, that needs to be included in it. - Add to
build.jsnew bundle, inmodulesobject. Name of module must bebundles/<your bundle name> - Load it somewhere in the app by calling
require(['bundles/mybundlename']);
Here is a small example of module
- Run it. This includes compiling and starting server.
- Implement list of coming soon movies on main page using Metacritic API
- Implement movie search using same Metacritic API
You can fork this repo and commit your code, so updates are easily tracked. Feel free to modify an app as you want and ask any questions to skype truthatenvy
##Rules
- No third-party services.
Optional:
- Remove blinking effect on page load
- Add gulp/grunt task, that will automatically rebuild application and start a node server