Skip to content

Hi there, this this small snippets to learn about Angular package the library :)

License

Notifications You must be signed in to change notification settings

ajaymarathe/angular-package-the-library

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

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 -

my-lib.component.ts
my-lib.component.scss
my-lib.component.html
my-lib.component.spec.ts
//my-lib.module.ts
  1. work on functionality that whatever you want do with above files after that you have to build your project - so hit followsing commands -
ng build my-lib

it will create following directory -

dist/<library-name>
  1. Publishing your library to NPM
ng build my-lib
cd dist/my-lib
npm publish
  1. You can build, test, and lint the project with CLI commands:
ng build my-lib
ng test my-lib
ng lint my-lib
  1. Reference links - https://youtu.be/l3wjN4datGs

About

Hi there, this this small snippets to learn about Angular package the library :)

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published