0.0.3 • Published 4 years ago

ngy-admin v0.0.3

Weekly downloads
10
License
-
Repository
github
Last release
4 years ago

NgyAdmin

Installation

Install the package

Using npm

npm install --save ngy-admin Karma.

Using yarn

yarn add ngy-admin

Install dependencies

NgyAdmin depends on several packages, you need to install these packages

npm install @angular/cdk @angular/material @api-platform/api-doc-parser @ngx-formly/core @ngx-formly/material @ngx-formly/schematics @ngx-loading-bar/core @ngx-loading-bar/http-client @ngx-loading-bar/router bootstrap change-case deepmerge lodash.get openapi-types pluralize

Import NgyAdminModule

In your root module, you need to import the module, use @angular/router and have an <router-outlet> in your root component

You also need to import import BrowserAnimationsModule from @angular/platform-browser/animations

import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { NgyAdminModule } from 'ngy-admin';
// ...

@NgModule({
  // ...
  imports: [
    // ...
    BrowserAnimationsModule,
    NgyAdminModule.forRoot({
      entrypoint: 'https://your-hydra-rest-api-url',
      basePath: 'admin',
    }),
    // ...
  ],
  // ...
})
export class AppModule { }

Add a global variable on window

In your index.html file, add the following line of code :

<script>window.global = window;</script>

Include Roboto font and Material Icons

For example, in your index.html file, add these lines

  <link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500&display=swap" rel="stylesheet">
  <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">

Include ngy-admin styles

@import '~ngy-admin/src/assets/scss/styles.scss';

That's it! You can run your app and access your admin in /admin

Enjoy

0.0.3

4 years ago

0.0.2

4 years ago