1.0.0 • Published 9 years ago

grunt-angular-eha-fixtures v1.0.0

Weekly downloads
2
License
Apache-2.0
Repository
github
Last release
9 years ago

grunt-angular-eha-fixtures

Generates a fixture collections map

Turns a list of JSON files:

❯ tree fixtures
fixtures
└── my-collection.json

… into an Angular constant:

angular.module('db', [])
  .constant('collections', {
    MY_COLLECTION: 'my-collection'
  });

Usage

Add something like the following to your Gruntfile:

ehaFixtures: {
  all: {
    options: {
      dest: '<%= yeoman.app %>/scripts/db.js'
    },
    files: [
      {
        expand: true,
        src: '<%= yeoman.app %>/scripts/fixtures/*.json'
      }
    ]
  }
}

… and run it:

❯ grunt ehaFixtures

Options

  • dest: path to write the Angular module (required)
  • moduleName: Angular module name (default: 'db')

Author

© 2015 Tom Vincent tom.vincent@ehealthnigeria.org

License

Released under the Apache-2.0 license.