Giter Site home page Giter Site logo

angular-feature-flags's Introduction

Build Status Coverage Status

angular-feature-flags

An AngularJS module that allows you to control when you release new features in your app by putting them behind feature flags/switches.

The idea

Abstracting your application functionality into small chunks and implementing them as loosely coupled directives. This allows you to completely remove sections of your application by simply toggling a single dom element.

How it works

The basic premise is you write your feature and wrap it up in a directive, then where you implement that directive in your markup you add the feature-flag directive to the same element. You can then pass the key of the flag to this directive to resolve whether of not this feature should be enabled.

The module pulls a json file down which defines the feature flags and which ones are active. If enabled angular will process the directive as normal, if disabled angular will remove the element from the dom.

You can then add the override panel to your app and turn individual features on override the server values, saving the override in local storage which is useful in development.

Flag data

The flag data that drives the feature flag service is a json format. Below is an example:

[
    { "key": "...", "active": "...", "name": "...", "description": "..." },
    ...
]
key Unique key that is used from the markup to resolve whether a flag is active or not.
active Boolean value for enabling/disabling the feature
name A short name of the flag (only visible in the list of flags)
description A long description of the flag to further explain the feature being toggled (only visible in the list of flags)

Configuration

FLAGS_URL A url or relative file path to retrieve the json file containing all the available feature flags. Configure this as a value on your module to override the default provided

Running the demo

Running the demo is easy assuming you have Gulp installed:

  • Checkout the project
  • Switch to the directory
  • Run 'gulp demo'

Should launch the demo in your default browser

Running the unit test

This relies on Gulp also obviously, to run the test suite:

  • Checkout the project
  • Switch to the directory
  • Run 'gulp test'

angular-feature-flags's People

Contributors

michaeltaranto avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.