npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

angular-eha.date-of-birth-or-age

v1.0.3

Published

Date of Birth or Age directive

Downloads

4

Readme

angular-eha.date-of-birth-or-age

Build Status Dependecy Status Dev Dependecy Status

Date of birth & Age features

Demo.

Usage

Installation

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

Distribution bundle

  • dist/date-of-birth-or-age.js
  • dist/date-of-birth-or-age.min.js
  • dist/date-of-birth-or-age.templates.js (default)
  • dist/date-of-birth-or-age.templates.min.js

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 Gruntfile:

wiredep: {
 ...
  options: {
    exclude: [
      'bower_components/date-of-birth-or-age/dist/date-of-birth-or-age.template.js'
    ]
  }
  ...
}

Then you're free to include whichever bundle you prefer in what ever manner you prefer.

Example

<html ng-app="dobExample">
  <head>
    <title>Back Button Example</title>
    <script src="bower_components/angular/angular.js"></script>
    <script src="bower_components/angular-eha.date-of-birth-or-age/dist/date-of-birth-or-age.template.js"></script>
    <script>
      var app = angular.module('dobExample', [
        'eha.date-of-birth-or-age'
      ]);

      app.controller('MyCtrl', function($scope) {
        $scope.person = {
          birthYear: '',
          birthMonth: '',
          birthDay: '',
          age: {
            years: '',
            months: ''
          }
        }
      });
    </script>
  </head>
  <body>
    <div ng-controller="MyCtrl">
      <eha-date-of-birth-or-age model="person"></eha-date-of-birth-or-age>
    </div>
  </body>
</html>

Contributing

Prerequisites

  • Firefox (for running test suite)
  • node (0.12.0)
  • bower (1.3.12)
  • grunt-cli (0.1.7)
  • grunt (0.4.5)

Installation

# Fork the upstream repo on github and pull down your fork
git clone [email protected]:yourusername/angular-eha.date-of-birth-or-age.git
# change into project folder
cd angular-eha.date-of-birth-or-age
# Add the upstream as a remote
git remote add upstream  [email protected]:eHealthAfrica/angular-eha.date-of-birth-or-age.git
# Install the dev dependencies
npm install

Docs

Code should be documented following the guidelines set out by jsdoc and ngdoc. We can then leverage Dgeni or something simlary to generate documentation in any format we like.

Test Suite

The test suite is configured to run in Firefox and is powered by:

  • Karma
  • Mocha
  • 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.

Running Tests

Single run
grunt test
Watch
grunt test:watch

Transpiling templates (html2js)

Transpiling our html templates into js allows us to neatly push them into the $templateCache.

To transpile the templates it's another simple grunt command:

grunt templates

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:

<script id="templates/date-of-birth-or-age.directive.tpl.html" type="text/html">
  // Your markup here
</script>

License

Copyright 2015 Matt Richards [email protected]

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

http://www.apache.org/licenses/LICENSE-2.0

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.