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

3.0.1 • Public • Published

NG Playground

Build Status Greenkeeper badge npm version

NG Playground enables developers to have a playground: easy setup to rapidly develop components/directives/pipes etc.

npm install --save-dev ng-playground
ng generate application playground

In the app.module.ts do as follows:

import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { PlaygroundModule, PlaygroundComponent } from 'ng-playground';
import {
  CaseAComponent,
  CaseBComponent,
  CaseCComponent
} from './cases';
import { CustomMenuAreaComponent } from './custom-menu-area/custom-menu-area.component';
 
@NgModule({
  declarations: [
    CaseAComponent,
    CaseBComponent,
    CaseCComponent,
    CustomMenuAreaComponent
  ],
  entryComponents: [
    CaseAComponent,
    CaseBComponent,
    CaseCComponent,
    CustomMenuAreaComponent
  ],
  imports: [
    BrowserModule,
    PlaygroundModule.configure({
      routes: [
        { title: 'Case A', component: CaseAComponent },
        { title: 'Parent', children: [ … ]},
        { title: 'Case C', component: CaseCComponent }
      ],
      customMenuComponent: CustomMenuAreaComponent
    })
  ],
  bootstrap: [PlaygroundComponent]
})
export class AppModule { }

In the index.html:

<body>
  <pg-playground></pg-playground>
</body>

In angular.json, add the styles:

"styles"[
  "node_modules/ng-playground/ng-playground.css"
]

Package Sidebar

Install

npm i ng-playground

Weekly Downloads

0

Version

3.0.1

License

none

Unpacked Size

198 kB

Total Files

37

Last publish

Collaborators

  • kmpeach