ng-string-rotate
TypeScript icon, indicating that this package has built-in type declarations

2.0.0 • Public • Published

String rotater

String rotater for Angular; Rotate the string in clockwise/ anti-clockwise

  • john -> ohnj
  • john -> hnjo
  • jacob -> bjaco (anti-clockwise)

Installation

npm install --save ng-string-rotate

Usage

Import StringRotateModule

You need to import the StringRotateModule in the module of your app where you want to use it.

import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';

import { AppComponent } from './app.component';
import { StringRotateModule } from 'ng-string-rotate';

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    StringRotateModule
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }

Use the ng-string-rotate selector

Place the ng-string-rotate and pass the string as an input to ngString and also the number of times need to rotate as shifts

<ng-string-rotate [ngString]="'john'" [shifts]="2"></ng-string-rotate>

For anti-clockwise pass the rotate input as 'reverse'

<ng-string-rotate [ngString]="'jacob'" [rotate]="'reverse'"></ng-string-rotate>

Package Sidebar

Install

npm i ng-string-rotate

Weekly Downloads

2

Version

2.0.0

License

none

Unpacked Size

72 kB

Total Files

24

Last publish

Collaborators

  • lijudev