https://github.com/ajaymarathe/angular-package-the-library
Hi there, this this small snippets to learn about Angular package the library :)
https://github.com/ajaymarathe/angular-package-the-library
angular angular-package angular-package-library angular-package-the-library library
Last synced: 5 months ago
JSON representation
Hi there, this this small snippets to learn about Angular package the library :)
- Host: GitHub
- URL: https://github.com/ajaymarathe/angular-package-the-library
- Owner: ajaymarathe
- License: mit
- Created: 2019-10-05T07:47:20.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2020-01-23T07:24:26.000Z (almost 6 years ago)
- Last Synced: 2025-06-13T19:04:21.433Z (5 months ago)
- Topics: angular, angular-package, angular-package-library, angular-package-the-library, library
- Size: 4.88 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# angular-package-library
Hi there, this this small snippets to learn about Angular package the library :)
1) first create blank angualr project `ng new demo --createApplication=false`
2) hit this command to create lib - `ng generate library my-lib`
3) then it will create library inside project directory -> inside library delete all files expect `my-lib.module.ts` file, then create following files -
```js
my-lib.component.ts
my-lib.component.scss
my-lib.component.html
my-lib.component.spec.ts
//my-lib.module.ts
```
4) work on functionality that whatever you want do with above files after that you have to build your project - so hit followsing commands -
```js
ng build my-lib
```
it will create following directory -
```js
dist/
```
5) Publishing your library to NPM
```js
ng build my-lib
cd dist/my-lib
npm publish
```
6) You can build, test, and lint the project with CLI commands:
```js
ng build my-lib
ng test my-lib
ng lint my-lib
```
7) Reference links - https://youtu.be/l3wjN4datGs