Questions tagged [angular-library]

Angular library is a means for building general solutions that can be adapted for re-use in different apps. They also can be published and shared as npm packages.

Filter by
Sorted by
Tagged with
0
votes
2answers
41 views

Include dependencies in Angular CLI libararies

I'm having issues with including Angular material dependency in the custom library. The primary application that includes a reference to the custom library throws an error "Cannot find @angular/...
0
votes
0answers
30 views

angular 8 library - unable to find components after npm link

i'm unable to use npm link to reference an local angular library in another angular project. These are the steps i did to build my dummy angular-lib with angular-cli: 1. ng new foo-lib --create-...
0
votes
1answer
40 views

Angular library - Can I import the components code?

I started to make my own components library for angular. the main reason is that I want to reuse components in future projects to be more productive and save time. Now I can install my library in ...
0
votes
0answers
18 views

angular cli use library in another library

I am trying to create a monorepo angular libraries project and getting an error. Can't bind to 'name' since it isn't a known property of 'lib1-component'. when trying to compile lib2 Package ...
0
votes
2answers
88 views

Angular pre-built theme is not working for Angular8 library

Pre-built Angular Material Theme is not working in a library in the same way like in an angular app. Created a style.css file in projects/example-lib folder and imported pre-built indigo-pink theme ...
1
vote
2answers
36 views

Why do i need *public-api.ts* and also *exports*

I am new to angular, started writing my first library, containing components, services, directives. i listed my components, services, directives in the library's exports array, but still: When ...
0
votes
1answer
21 views

when compiling a typescript library, how to build only to es2016?

I just wanted to compile my library in es2016 and obtain only the bundles directory. At tsconfig.lib.ts i wrote: "target": "es2016", But when compilling still appeard Compiling TypeScript sources ...
0
votes
0answers
24 views

Library component throw error as `lib-ibo-header' is not a known element`

I have created a angular library. after I create here is my library module: import { NgModule } from '@angular/core'; import { IBOLibraryComponent } from './ibo-library.component'; import { ...
0
votes
0answers
12 views

Angular APP_INITIALIZER in library module generates metadata compile time error

This is my ng library module code @NgModule({ imports: [NgIdleModule.forRoot()], providers: [ { provide: APP_INITIALIZER, useFactory: (idleStateChangeHandlerService: ...
0
votes
1answer
31 views

Angular router in external interceptor lib/module

I'm working in creating a external lib what main purpose is to implement a unique interceptor for my all web apps. Basically I created an Angular lib and I implement that lib in my web app and it ...
0
votes
1answer
53 views

Exposing a Pipe from an external module in Angular 8

I'm working on abstracting some utility libraries that we use in our projects. I've created a new Angular library which exposes some models, services and pipes. I need to be able to use a pipe ...
1
vote
0answers
33 views

Error building Angular Library : Cannot read property 'toString' of undefined

I have created a custom library to be used in my main angular application... However, when I try to build the library using ng build lib-name I am getting the error: **Cannot read property 'toString'...
1
vote
0answers
44 views

In angular what is difference between a node package and an angular 6 library?

I am new to angular and I understand the fact that in angular, node dependencies are stored in node_modules folder. Since I am working on angular 6, I have come across concept of angular libraries. ...
0
votes
2answers
40 views

StaticInjectorError when importing a custom-made Angular library

I've built my own Angular library (called ProcessorModule) and want to use it in other applications. Whenever I import the library however, I get the following error: StaticInjectorError(AppModule)[...
0
votes
1answer
69 views

Angular library created by CLI doesn't get auto import suggestion. Final bundle js file included double Angular code

TL;DR Source code: https://github.com/trungk18/multiple-projects I used CLI to create Angular library and consume it from another Angular application. But there was three problems. Why the auto ...
0
votes
0answers
36 views

Angular repo for multiple dependent apps and styling

I am developing an app which is growing beyond my initial expectations and needs to have a satellite app for administrative purposes. The initial app is built with angular-cli and has some components, ...
2
votes
1answer
52 views

Local Angular library using Highcharts breaks in production mode

I wrote an Angular library wrapping Highcharts to fit my needs. When using it locally in dev mode it runs well, but the optimization of the prod mode seems to break it. The problem comes from the ...
0
votes
0answers
110 views

Angular library bundledDependencies issue

I have the following configuration for my angular lib defined under projects/client-lib/package.json. { "name": "client-lib", "version": "0.0.1", "peerDependencies": { "@angular/common": "^...
0
votes
1answer
28 views

Publishing custom angular7 library to nexus

I am trying to publish the custom angular7 library to nexus repo, but when I am running command npm publish it is pushing the complete project dist folder instead it should only push the .tgz file ...
1
vote
1answer
251 views

Library build fails with Angular 9

I am trying to migrate this library https://github.com/flauc/angular2-notifications from Angular 2+ to Angular 9. The original error was about the ModuleWithProviders that has become a generic type, ...
0
votes
2answers
64 views

Pass environment.ts To Angular Library Module

I am building an Angular library which will expose a service and middleware to perform authentication when imported into other Angular apps. Before trying to pull this module into a standalone ...
0
votes
1answer
75 views

Class is not an Angular module - only in IntelliJ/Webstorm when importing locally build Angular library

I am trying to use Angular module implemented in a library (project) which exists in a separate Angular application. In IntelliJ I am getting an error Class MyModule is not an Angular module and all ...
0
votes
0answers
24 views

Do you need to redeploy Angular application to use updated library

I'm starting development on an Angular web application and I'm wondering if I would be able to create libraries for the application so I can deploy those independently from the main web app. If I ...
1
vote
1answer
307 views

Passing data from angular app to angular library

I need to be able to pass some data (configuration) from angular app to angular library. The requirement is that the configuration needs to be accessible in the decorator of library's NgModule, so I ...
0
votes
0answers
34 views

How to setup routes in custom angular library from application

I want to create a library in order to be able to use it in several applications. The library would be a module that allows you to connect using a portal. I would like to setup configurations to the ...
1
vote
0answers
27 views

Integrate an Angular library into a non-angular app

My scenario is as follows: I have built an Angular library that exposes a service, whose dependencies are passed in the constructor I have a separate AWS Lambda function (triggers on cron) that would ...
0
votes
0answers
14 views

How to create Angular 4 component to be used in multiple Angular 4 projects? NOT angular 6 [duplicate]

I want to create a component that can be used between multiple projects. Let's consider this, I have three different angular 4 projects A, B & C and there is no relation between the projects. ...
0
votes
1answer
71 views

Passing environment variables from one module to another in Angular 7

I am working on project that has Two Apps(App A, App B). There are around 100 components used by both apps. So I have created an Angular Library and organised those components in Modules. Everything ...
0
votes
1answer
66 views

Getting Angular Material to work in angular library

I'm trying to get Angular Material to work within an Angular Library. These are the steps I have taken: Create project ng new test-project Add Angular Material ng add @angular/material Create ...
0
votes
0answers
10 views

Use my private lib after deployment.(angular)

I am building two angular project under angular workplace with a shared library. I have no problem of using the library while I am developing. But the problem is What if I dont want to publish this ...
5
votes
4answers
1k views

BrowserslistError: Unknown version 67 of android

I have created one angular library using angular 8 and CLI 8. I am trying to build the library, but I am getting the error. ng build <lib-name> I have gone through some questions posted ...
0
votes
2answers
119 views

Angular library: Separate HttpInterceptor

What I want to achieve An encapsulated application (form editor) that I can use inside another angular application, but also in any web application. Idea The main modules/components could be ...
1
vote
1answer
33 views

what is the proper way to build angular library

Hi I am using angular 8 workplace to build multiple applications. In this project I need to build a lot libraries which could be shared with multiple applications. But I ran into problem with ...
1
vote
1answer
38 views

Angular custom library npm install gives Critical dependency: the request of a dependency is an expression

I've made a custom angular module library and after using it in my main app the library doesn't work and this is the warning that shows up Critical dependency: the request of a dependency is an ...
0
votes
0answers
18 views

How to build angular library with assets

I created a simple library with assets folder within the lib i want to use the images in assets folder in our library components after ng-build in our application,have any idea guys,Thanks in advance....
1
vote
0answers
45 views

Installing an Angular library from git

I'm following this article to build my shared angular library to use in my other projects. My library structure is like this repo. I'm trying to find a way to install it as a git dependency in my ...
0
votes
1answer
37 views

Is it possible to have scss file in dist folder of angular library?

Is it possible to have scss/css file in dist folder without using viewEncapsulation.None and gulp? While building the library I can only see the JS files but I want to import my component specific ...
0
votes
0answers
56 views

Use relative path for svg in Angular Library Component

I created a custom Library with Angular Cli. It has the following structure: - dist - projects - customLib - src - assets - icons - lib ...
2
votes
1answer
45 views

How to use relative path to files inside Angular Library?

I've created a library for theming, in which i'm changing the stylesheet path depending on the selected theme. My problem is that the path inside my library is assets/themes, but if I add the library ...
0
votes
0answers
22 views

Load a component while consuming angular library

let's say I have an angular library called my-lib. This library is a dialog which consist of header, content and a footer. My case is I want to consume this library and I want to load any component ...
0
votes
0answers
40 views

JavaScript Class when build angular library

I have global javscript class (in a js file, which declared in angular.json file) named ServerDate and I used this class in my library (named core) like this let xxx = new ServerDate() ...
0
votes
0answers
22 views

How to install dependencies of created libraries into parent app in angular library creation

I am creating a angular library using ng-packager and doing a npm_pack to create it into a tgz format I have installed few dependencies in the libraries (like moment, angular material etc) Now in my ...
0
votes
0answers
26 views

How to use filterChange on Kendo theme in NG-Dynamic-Forms

Kendo Angular UI filter some data on the Kendo Multiselect in the Kendo example they are using: @ViewChild("list") list; and the later in the ngAfterInit: this.list.filterChange.asObservable().pipe(...
1
vote
1answer
451 views

Include assets when building angular library

I am building a library which contains a custom icon font. However, when I build my library using ng build <library-name> --prod, the assets folder is not included in the build, which means ...
2
votes
1answer
56 views

HOW-TO: Angular library divided in independent feature sub libraries [closed]

I am currently developing an Angular library (in Angular v 8.1.0) and wondering how is it possible to have it "split in different sub-libraries"? For example, Angular (@angular) is split somehow in ...
0
votes
1answer
75 views

Running ng xi18n to generate messages.xlf on angular library throws error

I have a library component and I want to add internationalization feature to it. Therefore my html looks as follows for the tag I want internationalization to be applied. <div><span i18n="...
0
votes
3answers
772 views

NullInjectorError: No provider for ElementRef

I created an internal directive in a module in my project (Angular 8 + Material Design). Following tuto and official doc. @Directive({ selector: '[button-confirmation]' }) export class ...
0
votes
1answer
84 views

Load one module from Angular Library Instead of loading the whole library

I have an angular library that has been generated with the following command: ng generate library cac-models In this library, I have two modules named Admin and Client Module.When I'd like to use ...
0
votes
1answer
47 views

How to use baseUrl for absolute import statements in a library?

I have a library with a workspace containing two projects, one for the library itself and one for a test application. ├── projects    ├── midi-app    └── midi-lib In the workspace tsconfig.json ...
0
votes
0answers
59 views

Invalid path in Angular library

I am using Angular library and have the following folder structure: coollibrary - components - my.component.ts - services - my.service.ts public_api.ts In public_api, I export the ...