npm install ngx-flip --save
import { FlipModule } from 'ngx-flip';
// other imports
@NgModule({
imports: [
// other imports
FlipModule
],
// ...
})
export class AppModule {}
<ngx-flip [flip]="flipDiv" (click)="onClick()">
<div front>Front</div>
<div back>Back</div>
</ngx-flip>
Where
flip : boolean variable => used to flip the front and back div
<div front>Front</div> => Front div -- add 'front' as attribute to identify as front div
<div back>Back</div> => Back div -- add 'back' as attribute to identify as back div
import { Component } from '@angular/core';
@Component({ /* ... */ })
export class MyComponent {
flipDiv = false;
onClick() {
this.flipDiv = !this.flipDiv;
}
}
ng test
coming soon.
pull request always welcome!!!
This project is licensed under the terms of the **MIT ** license.