1.0.0 • Published 7 years ago
@adenix/ng-console v1.0.0
ng-console
Installation
To install this library, run:
$ npm install @adenix/ng-console --save
and then from your Angular AppModule
:
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppComponent } from './app.component';
// Import AxConsoleModule
import { AxConsoleModule } from '@adenix/ng-console';
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
// Specify AxConsoleModule as an import
AxConsoleModule
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
Usage
Once your library is imported, you can use its components, directives and pipes in your Angular application:
<!-- You can now the AxConsole components in app.component.html -->
<ax-console axShadow>
<ax-console-command *ngFor="let command of commands">
<ax-console-statement>{{command.body}}</ax-console-statement>
<!-- [responses] requires an array of Response objects (see below) -->
<ax-console-responses [responses]="command.responses"></ax-console-responses>
</ax-console-command>
</ax-console>
Response Object
The response object that is required by axConsoleCommand looks as follows:
[
{
"body": string,
"href": string (OPTIONAL)
},
...
]
License
MIT © Austin Nicholas