angular-simple-feature-flags

A configurable module for AngularJS that supports visibility-toggling (hiding/showing) of application components.

Added by: Sam Deering

GitHub

Repository

costacruise/angular-simple-feature-flags

Stats

Stars: 0

Watchers: 0

Forks: 0

Author

Costacruise
Costacruise

Module Description

#Angular Simple Feature Flags Angular Simple Feature Flags is a configurable module for AngularJS that supports visibility-toggling (hiding/showing) of application components. Feature flags (or feature toggles) are commonly used in CI (Continuous Integration) workflows as they allow for code to be continuously released in to production environments, with incomplete features hidden behind a feature flag.

##Get Started

(1) Get this module in one of the following ways:

  • download the release *
  • via Bower: by running $ bower install angular-simple-feature-flags from your console (recommended)

(2) Include angular-simple-feature-flags.js in your index.html, after including AngularJS itself

(3) Add 'simpleFeatureFlag' to your main module's list of dependencies:

angular.module('exampleApp', [
  'simpleFeatureFlags'
]);

(4) Add a new config function to your application where you can pass in a config array using the modules init method:

angular.module('exampleApp', [
    'simpleFeatureFlags'
  ])
  .config(function(FeatureFlagsProvider){
    FeatureFlagsProvider.init(
      [ 
        {'id': 'example0', 'active': true}, 
        {'id': 'example1', 'active': false},
        {'id': 'example2', 'active': false}
      ]
    );    
  }
);

Note: The config is expected as an array of objects in the above format.

(5) Specify which elements should be controlled by the feature flags config in either of the following ways:

Contained within a <feature-flags> element:

<feature-flag feature-key="example0">
  <div>
    <h1>This is my cool new feature!</h1>
  </div>
</feature-flag>

Or as an elements attribute:

<div feature-flag feature-key="example1">
  <h1>This is my cool new feature!</h1>
</div>

* If installing manually, you will also need to install Lodash as a dependency

###License Angular Simple Feature Flags is licensed under the MIT license

###Feedback Please add any bugs or feedback to the issue queue.

###Roadmap

  • Add minification to the gulp build
  • Further document the module‚Äôs API
  • Support the inclusion of a config JSON file via $http request

Module stats last updated: 2015-04-19 02:53:41

Disclaimer: Some data on this page may have been gathered from the authors GitHub respository. If you see any mistakes or outdated information please let us know. Thanks!