1 |
|
2 | ng-make cli
|
3 | =========
|
4 | ## Your life is simple with AngularJS but with ng-make even more!
|
5 |
|
6 |
|
7 | ![alt tag](http://www.angelocarraggi.altervista.org/ng-make/img/ng-makelogo.png)
|
8 |
|
9 | #### New Versioin 1.8.8 Fix name controller for delete ambiquity.
|
10 |
|
11 | ### Short Description!
|
12 |
|
13 |
|
14 | The ng-make command line utility makes it easy to make all with AngularJS.
|
15 | This command help you to manage your project without edit the route and the app configuration files.
|
16 | Use the `ng-make --help` command for more detailed task information.
|
17 |
|
18 |
|
19 | ##### Free for all!
|
20 | 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.
|
21 |
|
22 | ## Installing
|
23 |
|
24 | ```bash
|
25 | $ npm install -g ng-make
|
26 | ```
|
27 |
|
28 | *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](http://www.johnpapa.net/how-to-use-npm-global-without-sudo-on-osx/) to install without `sudo`. *
|
29 |
|
30 |
|
31 | ## Starting your project with AngularJS easily
|
32 |
|
33 | ```bash
|
34 | $ ng-make project nameProject
|
35 | ```
|
36 |
|
37 | When the command is launched it install the following components:
|
38 |
|
39 | angular ....... basic module of angularJS
|
40 | angular-ui ...... module for the routes page
|
41 |
|
42 | The structure of the project created with this command will be:
|
43 |
|
44 | appName/
|
45 | |
|
46 | |_css/ ( for the css style in your app)
|
47 | |
|
48 | |_js/ ( js module required by the app)
|
49 | |
|
50 | |_template/ (The view that you can be used)
|
51 | |
|
52 | |_img/ ( the image directory for your app )
|
53 | |
|
54 | |_bower_components/ (all components module)
|
55 | |
|
56 | |_settings/ ( settings for your application )
|
57 | | |
|
58 | | |_app.js
|
59 | | |
|
60 | | |_config.js
|
61 | | |
|
62 | | |_config.routes.js
|
63 | |
|
64 | |_module.json ( important file for the module installed in ng-make )
|
65 | |
|
66 | |_settings.conf ( important file for the settings of ng-make )
|
67 |
|
68 | ## Create your state in one command
|
69 |
|
70 | With ng-make you can create the state for your application. For make this quickly with ng-make you can use:
|
71 |
|
72 | ```bash
|
73 | $ ng-make state nameOfState [default] [abstract]
|
74 | ```
|
75 |
|
76 | This command update the file `config.routes.js` with the new lines of declare your state.
|
77 | It create the controller file append at the `nameOfState` the suffix `CTRL` and save it into the folder js,
|
78 | It create the html template (this view is empty) into the folder `template` named with the name of the state,
|
79 | It update the index.html with the `<script type="text/javascript" src="js/nameOfStateCTRL.js"></script>` before the end tag `</body>`.
|
80 |
|
81 | * If you using the option default, the state it's default, that is writed in `config.routes.js` within the `otherwise` property setted for the state.
|
82 |
|
83 | ## Testing your AngularJS App
|
84 |
|
85 | With ng-make you can also test your app without another XAMPP or LAMP software.
|
86 | For try your server you should be go into the folder project and launch this command:
|
87 |
|
88 | ```bash
|
89 | $ ng-make webstart [host] [port] [rootPoint]]
|
90 | ```
|
91 |
|
92 | * By default if you launch the command it used:
|
93 | - "localhost" as host
|
94 | - "port" as 9090
|
95 | - "rootPoint" as "./"
|
96 |
|
97 |
|
98 | ## Integration Module in your Angular App
|
99 |
|
100 | With ng-make you can install the new module in your angular app or install it from the repository available.
|
101 | Typically you use this command as:
|
102 |
|
103 | ```bash
|
104 | $ ng-make module [install|list|list-installed] nameOfNewModule [options]
|
105 | ```
|
106 |
|
107 | The available keywords can be used like below:
|
108 |
|
109 | `ng-make module install nameOfAvailablePackage`
|
110 |
|
111 | With this command you add the `nameOfAvailablePackage` in your angular project.
|
112 | For obtain the list of available package in ng-make, you can run this command:
|
113 |
|
114 | ```bash
|
115 | $ ng-make module list
|
116 | ```
|
117 |
|
118 | For obtain the list of install modules in your angular app you can run this:
|
119 |
|
120 | ```bash
|
121 | $ ng-make module list-installed
|
122 | ```
|
123 |
|
124 | ## Create your service for your Angular App
|
125 |
|
126 |
|
127 | ```bash
|
128 | $ ng-make service nameOfService
|
129 | ```
|
130 |
|
131 | With this command you can create into the js/service/ directory your service that you can used in your AngularJS App.
|
132 |
|
133 |
|
134 | ## Create your factory for your Angular App
|
135 |
|
136 |
|
137 | ```bash
|
138 | $ ng-make factory nameOfFactory
|
139 | ```
|
140 |
|
141 | With this command you can create into the js/factory/ directory your factory that you can used in your AngularJS App.
|
142 |
|
143 |
|
144 | #### Create your directive for your Angular App
|
145 |
|
146 | ```bash
|
147 | $ ng-make directive nameOfDirective
|
148 | ```
|
149 | With this command you can create into the js/directive/nameOfDirectiveDir/ directory your directive (JS,HTML) that you can used in your AngularJS App.
|
150 |
|
151 | It's create this on your project:
|
152 |
|
153 | appName/
|
154 | |
|
155 | |_css/ ( for the css style in your app)
|
156 | |
|
157 | |_js/ ( js module required by the app)-----------
|
158 | | |_______directive/
|
159 | |_template/ (The view that you can be used) |_nameOfDirective/
|
160 | | |_nameOfDirective.js (declaretion of directive)
|
161 | |_img/ ( the image directory for your app ) |_nameOfDirectiveCtrl.js (controller for directive)
|
162 | | |_nameOfDirective.html (template for directive)
|
163 | |_bower_components/ (all components module)
|
164 | |
|
165 | |_settings/ ( settings for your application )
|
166 | | |
|
167 | | |_app.js
|
168 | | |
|
169 | | |_config.js
|
170 | | |
|
171 | | |_config.routes.js
|
172 | |
|
173 | |_module.json ( important file for the module installed in ng-make )
|
174 | |
|
175 | |_settings.conf ( important file for the settings of ng-make )
|
176 |
|
177 |
|
178 |
|
179 |
|
180 | ## Version history
|
181 |
|
182 | ####Versioin 1.8.4 Insert new keyword: directive!
|
183 |
|
184 | ####Versioin 1.8.2 Insert new keyword: factory!.
|
185 |
|
186 |
|
187 | ####Versioin 1.8.1 Correct the module install and fix all help description for all keywords.
|
188 |
|
189 |
|
190 | ####Versioin 1.8.0 Create service keyword for the ng-make and fix all index dependencies!
|
191 |
|
192 |
|
193 | With the version 1.8.0 ng-make add the keyword for make your service without configure it.
|
194 | For create a new service you can write in terminal ( use this when you are in the root directory of your app ):
|
195 |
|
196 | ```bash
|
197 | $ ng-make service nameOfService
|
198 | ```
|
199 |
|
200 |
|
201 | ####Version 1.7.4
|
202 |
|
203 |
|
204 | `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`
|
205 |
|
206 |
|
207 |
|
208 |
|