Installation
-
Clone or download the library to your computer.
-
Using the terminal
cd
go to thebidcoreng
folder. -
Compile in
root
folder.
yarn installyarn build// OR use the npm commandsnpm installnpm run build
npm ERR! Error: EPERM: operation not permitted, scandir
NOTE: If this error arises 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 commandsnpm link
cd
to your project and run
yarn link bidcoreng// OR use the npm commandsnpm link bidcoreng
- Now you can run with
yarn start// OR use the npm commandsnpm 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 your library;
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 --> {{title}}
Services must be imported into the app module as well.
;;; ; // Import your library;
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
;
constructorprivate libraryService: typescript