3.0.1 • Published 10 years ago

angular2-suite-flipper v3.0.1

Weekly downloads
3
License
ISC
Repository
github
Last release
10 years ago

Angular2 Suite Flipper

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

Install

npm install --save angular2-suite-flipper

Setup

provide flippers in your bootstrap

provide('flippers', { useValue: ['dummy', 'test'] });

Usage in template

import { IsOnPipe } from 'angular2-suite-flipper';
import { IsOffPipe } from 'angular2-suite-flipper';

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

Usage in Controller

import { FlipperService } from 'angular2-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);
  }
}
3.0.1

10 years ago

3.0.0

10 years ago

2.0.3

10 years ago

2.0.2

10 years ago

2.0.1

10 years ago

2.0.0

10 years ago

1.0.2

10 years ago

1.0.1

10 years ago

1.0.0

10 years ago