Skip to content

willmendesneto/angular2-feature-toggle

Repository files navigation

Angular2 FeatureToggle

Build Status

Coverage Status

DEPRECATED

This project has been deprecated. Please use ngx-feature-toggle instead. More details in the Github repository or in the NPM page for ngx-feature-toggle.

Your module to handle with feature toggles in Angular2 applications easier.

Why Feature toggle?

This is a common concept, but why use this directive instead solve it via server-side rendering?

The idea of this directive is make this process transparent and easier. So the main point is integrate this directive with other tooling process, such as:

  • Server-side rendering;
  • Progressive rendering;
  • Any other that yoy like :)

You can integrate with WebSockets or handling this in a EventSourcing architecture. It's totally transparent for you and you can integrate easier in your application

Instalation and usage

Install angular2-feature-toggle module as a project dependency.

$ npm install --save angular2-feature-toggle

After that you just need to import the FeatureToggleModule into your application and the directive will be accessible in your application.

import { FeatureToggleModule } from 'angular2-feature-toggle';
...
@NgModule({
  ...
  imports: [ FeatureToggleModule ],
  ...
})
...
<div *featureToggle="true">
  condition is true and `featureToggle` is enabled.
</div>
<div *featureToggle="false">
  condition is false and `featureToggle` is disabled.
</div>

Running unit tests

Run npm test to execute the unit tests via Karma.

Running the build

Run npm run build

How to contribute

This package is using the AngularJS commit messages as default way to contribute with commitizen node package integrated in this repository. If you are not so familiar with the Angular projeto commit messages standard, please commit your contribution using:

$ npm run commit

Live example

https://plnkr.co/edit/RepjOclLXM32YbCgC4vv

Author

Wilson Mendes (willmendesneto)

About

Your module to handle with feature toggles in Angular2 applications easier.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published