Date of birth & Age features
Install with npm:
npm install --save angular-eha.date-of-birth-or-age
Or alternatively bower:
bower install --save angular-eha.date-of-birth-or-age
- dist/date-of-birth-or-age.templates.js (default)
Then simply add
eha.date-of-birth-or-age as dependencies somewhere in your project that makes sense and you're good to go.
A note on wiredep
If you're using wiredep
dist/date-of-birth-or-age.template.js will be injected by default. If you don't want that to happen you'll like want to employ something along the following lines in your
Then you're free to include whichever bundle you prefer in what ever manner you prefer.
Back Button Example
- Firefox (for running test suite)
- node (0.12.0)
- bower (1.3.12)
- grunt-cli (0.1.7)
- grunt (0.4.5)
# Fork the upstream repo on github and pull down your forkgit clone firstname.lastname@example.org:yourusername/angular-eha.date-of-birth-or-age.git# change into project foldercd angular-eha.date-of-birth-or-age# Add the upstream as a remotegit remote add upstream email@example.com:eHealthAfrica/angular-eha.date-of-birth-or-age.git# Install the dev dependenciesnpm install
The test suite is configured to run in Firefox and is powered by:
- Chai (as promised)
- Sinon (chai)
The library is conducive to TDD.
grunt test:watch is your friend. As modules (and templates) are exposed on their own namespace you can easily isolate areas of the code base for true unit testing without being forced to pull in the whole library or stub/mock modules irrelevant to the feature(s) you're testing.
Transpiling templates (html2js)
Transpiling our html templates into js allows us to neatly push them into the
To transpile the templates it's another simple grunt command:
This will compile the templates to the
dist/ folder. But it's probably best to avoid this all together. Both the
grunt test and
grunt release commands take care of all of this for you.
If you need to override the default template, simply replace what's already in the
$templateCache with what ever you want. One way to achieve this is like this:
Copyright 2015 Matt Richards firstname.lastname@example.org
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.