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

1.0.2 • Public • Published

Installation

  1. Clone or download the library to your computer.

  2. Using the terminal cd go to the bidcoreng folder.

  3. Compile in root folder.

yarn install
yarn build
// OR use the npm commands
npm install
npm run build

NOTE: If this error arises npm ERR! Error: EPERM: operation not permitted, scandir

please run npm cache verify (https://github.com/npm/npm/issues/17747)

  1. Run tests often with yarn test

  2. Run tslint often with yarn lint

  3. Connect the library to your project with

yarn link
// OR use the npm commands
npm link
  1. cd to your project and run
yarn link bidcoreng
// OR use the npm commands
npm link bidcoreng
  1. Now you can run with
yarn start
// OR use the npm commands
npm run start

From now on you do not need to link your library again (unless a new dependency is installed), but caution after changing something in the library and saving, to see your changes reproduce steps 3. and 7..

{-IMPORTANT-} Sometimes after changes in the library if one of the following errors occur

  • Can not find AllLibraryServicesListed OR
  • ENOENT not index.js file exists

The consumer project must be rerun!

Changes in your project are live updated not needing to rerun the app.

Connect to your project

(Be sure to also check https://git.bidcore.de/tsioris/bidcoreNG/wikis/fixing-error )

From your Angular AppModule:

import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppComponent } from './app.component';
 
// Import your library
import { NameOfTheModuleYouWantToUse } from 'bidcoreng';
 
@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
 
    // Specify your library as an import
    NameOfTheModuleYouWantToUse
  ],
  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 use your library component in app.component.html -->
<h1>
  {{title}}
</h1>
<exampleComponent></exampleComponent>

Services must be imported into the app module as well.

import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppComponent } from './app.component';
 
import { NameOfTheModuleYouWantToUse } from 'bidcoreng';
 
// Import your library
import {  
    TableExpandableRowService,
    BidModalService,
    CustomValidators,
    OptionsValidatorService,
    BidListFormService,
    StackViewService } from 'bidcoreng';
 
@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
 
    NameOfTheModuleYouWantToUse
  ],
  providers: [
    // Specify your service as a provider
    TableExpandableRowService,
    BidModalService,
    CustomValidators,
    OptionsValidatorService,
    BidListFormService,
    StackViewService
],
  bootstrap: [AppComponent]
})
export class AppModule { }

and to use the service inside your components you finally need to import it in each component needing it, or having as Child nodes bidcoreNG components requiring it

    import { RequiredLibraryService } from 'bidcoreng';
    constructor(private libraryServicetypescript){}

Package Sidebar

Install

npm i bidcoreng

Weekly Downloads

0

Version

1.0.2

License

Apache License 2.0

Unpacked Size

6.17 MB

Total Files

409

Last publish

Collaborators

  • hberndt