https://github.com/ogm710811/creating-a-library-with-the-angular-cli-using-the-library-in-a-separate-application
Create a test workspace so we can see what it looks like for people to actually use the library in their own application. This a second part of the repository Creating-a-Library-with-the-Angular-CLI
https://github.com/ogm710811/creating-a-library-with-the-angular-cli-using-the-library-in-a-separate-application
Last synced: 4 months ago
JSON representation
Create a test workspace so we can see what it looks like for people to actually use the library in their own application. This a second part of the repository Creating-a-Library-with-the-Angular-CLI
- Host: GitHub
- URL: https://github.com/ogm710811/creating-a-library-with-the-angular-cli-using-the-library-in-a-separate-application
- Owner: ogm710811
- Created: 2018-08-18T23:55:11.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2018-08-19T00:01:50.000Z (almost 7 years ago)
- Last Synced: 2025-01-15T08:10:20.677Z (6 months ago)
- Language: TypeScript
- Size: 93.8 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Example Angular 6 Library App Part 2 Repository
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 6.1.4.
## Development server
Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.
## Project Description
Now that we know how to build and package an Angular library, let’s create another test workspace so we can see what it looks like for people to actually use the library in their own application.
## Project WorkSpace
Create a test workspace so you can use the library in that application.
## Using the Library in a Separate Application
To use the library in the new application >>> npm install ../example-ng6-lib/dist/example-ng6-lib/example-ng6-lib-0.0.1.tgz
## Tips
1. ALWAYS: Install the library’s .tgz package and NOT the directory.
2. In order to actually use a component from the library we need to add the library’s module to our App Module. To do this we make two changes in: src\app\app.module.ts
2.1. Import the ExampleNg6LibModule >>> import { ExampleNg6LibModule } from 'example-ng6-lib';
2.2. Add the ExampleNg6LibModule to the imports array in our AppModule.## Further help
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md).