0.1.5 • Published 5 years ago

ngx-adibro-console v0.1.5

Weekly downloads
29
License
-
Repository
-
Last release
5 years ago

ngx-adibro-console for Angular 7+

This is an angular component for emulating terminal/console.

Installation

npm install --save ngx-adibro-console

For demos please visit

demos

Usage

Inside app.module file import the component and service:

import { NgxAdibroConsoleModule, NgxAdibroConsoleService } from 'ngx-adibro-console';

@NgModule({
  declarations: [
    ...
  ],
  imports: [
    ... ,
        NgxAdibroConsoleModule,
    ... ,
  ],
  providers: [
      NgxAdibroConsoleService
  ],
  bootstrap: [...]
})
export class AppModule { }

In your HTML file you can do:

<ngx-adibro-console [width]="50" [height]="50" [welcomeMessage]="'Hello .....'" [promptMessage]="'Godamn $'" [clearAll]="true" [cacheCommands]="true"></ngx-adibro-console>

You can then usre it in your component file like so:

export class AppComponent {
constructor(public ngxAdibroConsoleService: NgxAdibroConsoleService) {
    this.ngxAdibroConsoleService.commandHandler.subscribe(command => {
      let result = (command.toLowerCase() === 'Date'.toLowerCase()) ? new Date().toString() : command;
      this.ngxAdibroConsoleService.sendResponse(result);
    })

  }
}

Have fun !!!

0.1.5

5 years ago

0.1.4

5 years ago

0.1.3

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago

0.0.1

5 years ago