Cool Console is an angular library that displays cool messages in console.
npm install cool-console --save
Add CoolConsoleModule to App NgModule
import { CommonModule } from '@angular/common';
import { CoolConsoleModule } from 'ng-cool-console';
@NgModule({
imports: [
CommonModule,
CoolConsoleModule.forRoot()
],
bootstrap: [App],
declarations: [App]
})
class MainModule {}
import { CoolConsoleModule } from 'ng-cool-console';
@Component({...})
export class YourComponent {
constructor(private cc: CoolConsoleService) {
this.cc.success('β Successfully Initialized!');
this.cc.warning('β Global Warning!');
this.cc.danger('π World is in danger!');
this.cc.info('π Everything will be okay!');
this.cc.info({ name: 'ng-cool-console' });
/* Custom Log
* @param1 args
* @param2 color
* @param3 backgroundColor
*/
this.cc.log('π Everything will be okay!', 'black', 'red');
}
}
Global options include the following options:
Option | Type | Default | Description |
---|---|---|---|
padding | string | '5px 10px' | Sets the padding for the console string box |
borderRadius | string | '2px' | Sets the border radius for the console string box |
fontSize | string | '16px' | Classes used on toastr service methods |
Pass values to CoolConsoleModule.forRoot()
// AppModule
imports: [
CoolConsoleModule.forRoot({
padding: '6px 12px',
borderRadius: '5px',
fontSize: '18px'
})
],
MIT
Author: @eneajaho