This project was generated with Angular CLI version 13.1.0.
Code for the library(ies) of @ng-ar/md-input, @ng-ar/svg-icon, @ng-ar/input and @ng-ar/bg-svg is(are) included in this repo.
$ ng new my-workspace --no-create-application
$ cd my-workspace
$ ng generate library my-libwe can create libraries with angular app also
$ cd my-workspace
$ ng generate library my-lib --prefix demo ng g lib my-lib --prefix demoThis adds a
projectsdirectory containing amy-libdirectory(library folder) for our newly generatedmy-workspaceAngular workspace.
ng generate application my-appThis adds a
my-appdirectory(application folder) in theprojectsdirectory
ng g d <directive-name> --project=<project-name>one example
ng g d directives/input-ref --project=md-input --dry-run--dry-run flag won't generate anything, but will show in console.
$ ng build my-lib --configuration development
$ ng test my-lib
$ ng lint my-libng build my-libng serve my-app$ ng build my-lib
$ cd dist/my-lib
$ npm publishWhwn publishing first time to the public repo of npm, please use the below command.
npm publish --access publicWhen including additional assets like Sass mixins or pre-compiled CSS. You need to add these manually to the conditional exports in the package.json of the primary entrypoint.
ng-packagr will merge handwritten exports with the auto-generated ones, allowing for library authors to configure additional export subpaths, or custom conditions.
"exports": {
".": {
"sass": "./_index.scss",
},
"./theming": {
"sass": "./_theming.scss"
},
"./prebuilt-themes/indigo-pink.css": {
"style": "./prebuilt-themes/indigo-pink.css"
}
}ng build my-lib --watch$ cd dist/my-lib
$ npm linkNow open the seperate angular app where you want to test it
npm link my-libIf you already have my-lib it installed through npm
npm uninstall my-libadd the following to the root package.json file
"scripts": {
...
"build_lib": "ng build my-lib",
"npm_pack": "cd dist/my-lib && npm pack",
"package": "npm run build_lib && npm run npm_pack"
},npm install ../angular-lib-demo/dist/my-lib/my-lib-0.0.1.tgz
import { AngularLibDemoModule } from 'my-lib';- To begin, add the
angular-cli-ghpagesbuilder.
ng add angular-cli-ghpages- If you’re deploying the project to a Github project page you’ll need to set the
baseHrefproperty as the repository name. ThebaseHrefwill be used for all relative URLs on your site. You could specify thebaseHrefas part of the project architect deploy options in theangular.jsonfile. Or just pass it as the--base-hrefflag to theng deploycommand. If you’re deploying the project to a Github user page, you do not need to set this option.
ng deploy --base-href=/<repository-name>/GitHub will automatically enable Pages when you push a gh-pages branch. There is no need to enable Pages from the repository settings.
ng deploy --base-href=/angular-lib-demo/- Creating libraries - Official
- The Angular Library Series - Creating a Library with Angular CLI
- Create your Angular Library and linking
- Material Icons' Symbols
- Material Icons Guide
- 'angular-svg-icon' repo
- Angular: Using custom made SVG icons through Angular Material
- Material Icon - custom icons
- Free Svg Repo
- Hex Color To CSS Filter Converter
- Free svg background - heazy
- Free svg background - haikei