|
1 | | -# AngularUI - The companion suite for AngularJS |
| 1 | +# UI.Utils [](https://travis-ci.org/angular-ui/ui-utils) |
2 | 2 |
|
3 | | -*** |
| 3 | +The companion suite for AngularJS |
4 | 4 |
|
5 | | -[](https://travis-ci.org/angular-ui/ui-utils) |
| 5 | +## Requirements |
| 6 | + |
| 7 | +- AngularJS |
6 | 8 |
|
7 | 9 | ## Usage |
8 | 10 |
|
9 | | -### Requirements |
10 | 11 |
|
11 | | -* **AngularJS v1.0.0+** is currently required. |
12 | | -* **jQuery*** Until the refactor is complete, some directives still require jQuery |
| 12 | +You can get it from [Bower](http://bower.io/) |
| 13 | + |
| 14 | +```sh |
| 15 | +# All the modules |
| 16 | +bower install angular-ui-utils\#bower |
| 17 | + |
| 18 | +# A specific module |
| 19 | +# bower install angular-ui-utils\#bower-<moduleName> |
| 20 | +bower install angular-ui-utils\#bower-event |
| 21 | +bower install angular-ui-utils\#bower-keypress |
| 22 | +... |
| 23 | + |
| 24 | +# A specific version |
| 25 | +bower install angular-ui-utils\#v0.0.4 |
| 26 | +# A specific module version |
| 27 | +bower install angular-ui-utils\#event-0.0.4 |
| 28 | +bower install angular-ui-utils\#keypress-0.0.4 |
| 29 | +... |
| 30 | + |
| 31 | +# If you want the sources with it |
| 32 | +bower install angular-ui-utils |
| 33 | +# or for a specific source version |
| 34 | +bower install angular-ui-utils\#src0.0.4 |
| 35 | +``` |
| 36 | + |
| 37 | +This will copy the UI.Utils files into a `bower_components` folder, along with its dependencies. Load the script files in your application: |
| 38 | + |
| 39 | +```html |
| 40 | +<script type="text/javascript" src="bower_components/angular/angular.js"></script> |
| 41 | +<!-- for all the modules --> |
| 42 | +<script type="text/javascript" src="bower_components/angular-ui-utils/ui-utils.js"></script> |
13 | 43 |
|
14 | | -## Installation |
| 44 | +<!-- or just specific one--> |
| 45 | +<script type="text/javascript" src="bower_components/angular-ui-event/event.js"></script> |
| 46 | +<script type="text/javascript" src="bower_components/angular-ui-keypress/keypress.js"></script> |
| 47 | +<!-- ... --> |
| 48 | +``` |
15 | 49 |
|
16 | 50 | Add the specific modules to your dependencies, or add the entire lib by depending on `ui.utils` |
17 | 51 |
|
18 | 52 | ```javascript |
19 | 53 | angular.module('myApp', ['ui.keypress', 'ui.event', ...]) |
20 | 54 | // or if ALL modules are loaded along with modules/utils.js |
21 | | -angular.module('myApp', ['ui.utils']) |
| 55 | +var myAppModule = angular.module('MyApp', ['ui.utils']); |
22 | 56 | ``` |
23 | 57 |
|
24 | 58 | Each directive and filter is now it's own module and will have a relevant README.md in their respective folders |
25 | 59 |
|
26 | 60 | ## Development |
27 | 61 |
|
28 | | -At this time, we do not have a build script. You must include all `.js` files you wish to work on. |
29 | | -We will likely be adding a `Gruntfile.js` in the near future for this |
| 62 | +We use Karma and jshint to ensure the quality of the code. The easiest way to run these checks is to use grunt: |
30 | 63 |
|
31 | | -### Requirements |
| 64 | +```sh |
| 65 | +npm install -g grunt-cli |
| 66 | +npm install && bower install |
| 67 | +grunt |
| 68 | +``` |
32 | 69 |
|
33 | | -0. Install [Node.js](http://nodejs.org/) and NPM (should come with) |
| 70 | +The karma task will try to open Firefox and Chrome as browser in which to run the tests. Make sure this is available or change the configuration in `test\karma.conf.js` |
34 | 71 |
|
35 | | -1. Install global dependencies `grunt-cli`, `bower`, and `karma`: |
36 | 72 |
|
37 | | - ```bash |
38 | | - $ npm install -g karma grunt-cli bower |
39 | | - ``` |
| 73 | +### Grunt Serve |
40 | 74 |
|
41 | | -2. Install local dependencies: |
| 75 | +We have one task to serve them all ! |
42 | 76 |
|
43 | | - ```bash |
44 | | - $ npm install |
45 | | - $ bower install |
46 | | - ``` |
| 77 | +```sh |
| 78 | +grunt serve |
| 79 | +``` |
47 | 80 |
|
48 | | -### Running Tests |
| 81 | +It's equal to run separately: |
49 | 82 |
|
50 | | -Make sure all tests pass in order for your Pull Request to be accepted |
| 83 | +* `grunt connect:server` : giving you a development server at [http://127.0.0.1:8000/](http://127.0.0.1:8000/). |
51 | 84 |
|
52 | | -You can choose what browsers to test in: `Chrome,ChromeCanary,Firefox,PhantomJS` |
| 85 | +* `grunt karma:server` : giving you a Karma server to run tests (at [http://localhost:9876/](http://localhost:9876/) by default). You can force a test on this server with `grunt karma:unit:run`. |
53 | 86 |
|
54 | | -```bash |
55 | | -$ karma start --browsers=Chrome,Firefox test/karma.conf.js --single-run=true |
56 | | -``` |
| 87 | +* `grunt watch` : will automatically test your code and build your demo. You can demo generation with `grunt build:gh-pages`. |
0 commit comments