bidcoreng
v1.0.2
Published
Bidcore library to deal with complex data and autogenerate tables and forms
Downloads
2
Maintainers
Readme
Installation
Clone or download the library to your computer.
Using the terminal
cd
go to thebidcoreng
folder.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)
Run tests often with
yarn test
Run tslint often with
yarn lint
Connect the library to your project with
yarn link
// OR use the npm commands
npm link
cd
to your project and run
yarn link bidcoreng
// OR use the npm commands
npm link bidcoreng
- 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 libraryService: typescript){}