The ng-make command line utility makes it easy to make all with AngularJS.
This command help you to manage your project without edit the route and the app configuration files.
ng-make --help command for more detailed task information.
If you want to add a new module into the repository of ng-make, go to this(http://www.angelocarraggi.altervista.org/ng-make) and you can add your module into ng-make repository.
$ npm install -g ng-make
*Note: For a global install of
-g ng-make, OSX/Linux users may need to prefix the command with
sudo or can setup proper file permissions on OSX for npm to install without
$ ng-make project nameProject
When the command is launched it install the following components:
angular ....... basic module of angularJS angular-ui ...... module for the routes page
The structure of the project created with this command will be:
appName/ | |_css/ ( for the css style in your app) | |_js/ ( js module required by the app) | |_template/ (The view that you can be used) | |_img/ ( the image directory for your app ) | |_bower_components/ (all components module) | |_settings/ ( settings for your application ) | | | |_app.js | | | |_config.js | | | |_config.routes.js | |_module.json ( important file for the module installed in ng-make ) | |_settings.conf ( important file for the settings of ng-make )
With ng-make you can create the state for your application. For make this quickly with ng-make you can use:
$ ng-make state nameOfState [default] [abstract]
This command update the file
config.routes.js with the new lines of declare your state.
It create the controller file append at the
nameOfState the suffix
CTRL and save it into the folder js,
It create the html template (this view is empty) into the folder
template named with the name of the state,
It update the index.html with the
otherwiseproperty setted for the state.
With ng-make you can also test your app without another XAMPP or LAMP software. For try your server you should be go into the folder project and launch this command:
$ ng-make webstart [host] [port] [rootPoint]]
With ng-make you can install the new module in your angular app or install it from the repository available. Typically you use this command as:
$ ng-make module [install|list|list-installed] nameOfNewModule [options]
The available keywords can be used like below:
ng-make module install nameOfAvailablePackage
With this command you add the
nameOfAvailablePackage in your angular project.
For obtain the list of available package in ng-make, you can run this command:
$ ng-make module list
For obtain the list of install modules in your angular app you can run this:
$ ng-make module list-installed
$ ng-make service nameOfService
With this command you can create into the js/service/ directory your service that you can used in your AngularJS App.
$ ng-make factory nameOfFactory
With this command you can create into the js/factory/ directory your factory that you can used in your AngularJS App.
$ ng-make directive nameOfDirective
With this command you can create into the js/directive/nameOfDirectiveDir/ directory your directive (JS,HTML) that you can used in your AngularJS App.
It's create this on your project:
appName/ | |_css/ ( for the css style in your app) | |_js/ ( js module required by the app)----------- | |_______directive/ |_template/ (The view that you can be used) |_nameOfDirective/ | |_nameOfDirective.js (declaretion of directive) |_img/ ( the image directory for your app ) |_nameOfDirectiveCtrl.js (controller for directive) | |_nameOfDirective.html (template for directive) |_bower_components/ (all components module) | |_settings/ ( settings for your application ) | | | |_app.js | | | |_config.js | | | |_config.routes.js | |_module.json ( important file for the module installed in ng-make ) | |_settings.conf ( important file for the settings of ng-make )
With the version 1.8.0 ng-make add the keyword for make your service without configure it. For create a new service you can write in terminal ( use this when you are in the root directory of your app ):
$ ng-make service nameOfService
Adding livereload at webstart keywords also you can run the typical command of ng-make, fix about more keywords such as module state and project