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.
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
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>
Run npm test
to execute the unit tests via Karma.
Run npm run build
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
https://plnkr.co/edit/RepjOclLXM32YbCgC4vv
Wilson Mendes (willmendesneto)