@emartech/angular-suite-flipper

Angular module for Suite FLipper

Stats

StarsIssuesVersionUpdatedCreatedSize
@emartech/angular-suite-flipper
022.1.2a year ago5 years agoMinified + gzip package size for @emartech/angular-suite-flipper in KB

Readme

Angular Suite Flipper

This is a simple flipper solution for angular. You should provide the flippers.

Install

npm install --save @emartech/angular-suite-flipper

Setup

import { FlipperModule } from '@emartech/angular-suite-flipper';

@NgModule({
  imports: [
    BrowserModule,
    FlipperModule.create(['dummy', 'test'])
  ],
  declarations: [AppComponent],
  bootstrap:    [AppComponent]
})
export class AppModule { }

Usage in template


import { IsOnPipe } from '@emartech/angular-suite-flipper';
import { IsOffPipe } from '@emartech/angular-suite-flipper';

@Component({
  selector: '<sub-app>',
  template: `
    <h1 *ngIf="'dummy' | isOff">With</h1>
    <h1 *ngIf="'dummy' | isOn">Without</h1>
  `
})
export class App {}

Usage in Controller


import { FlipperService } from '@emartech/angular-suite-flipper';

@Component({
  selector: '<sub-app>',
  template: `Some content`
})
export class App {

  constructor(flipperService: FlipperService) {
    if (flipperService.isOn('dummy')) console.log(1);
    if (flipperService.isOff('dummy')) console.log(2);
  }
}

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.