JSPM

ng-string-rotate

2.0.0
    • ESM via JSPM
    • ES Module Entrypoint
    • Export Map
    • Keywords
    • License
    • Repository URL
    • TypeScript Types
    • README
    • Created
    • Published
    • Downloads 4
    • Score
      100M100P100Q32362F

    Package Exports

    • ng-string-rotate

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (ng-string-rotate) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    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>