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.

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. https://angular.io/guide/libraries

629 questions
7
votes
4 answers

One or more import cycles would need to be created to compile this component, which is not supported by the current compiler configuration

I have an old angular library and when I migrate to angular 12 and try to build my library I am getting the below error: projects/namespace/lin-folder/src/lib/components/alerts/alerts.component.ts:7:1 7 @Component({ ~~~~~~~~~~~~ …
Aniruddha Das
  • 20,520
  • 23
  • 96
  • 132
7
votes
2 answers

Angular shared assets within multiple applications

I am working on multiple small apps, which will share common and shared modules, and assets. The part about how to create project structure was answered here: https://stackoverflow.com/a/61254557/1351452 My project folders structure is as…
Filip Witkowski
  • 795
  • 3
  • 14
  • 24
7
votes
1 answer

Importing a publishable library into another library Fails Angular

I am trying to find a Fix for Importing libs in Angular . I am following this open issue on github. I am not able to get my head around this . My First Library is build and there in dist folder and in my new library when i try and import i get…
Rahul Singh
  • 19,030
  • 11
  • 64
  • 86
7
votes
2 answers

Angular 6 Library - Could not resolve entry

I am getting the following error while building the angularlibrary project. Building Angular Package Building entry point '@abc/lib' Compiling TypeScript sources through ngc Bundling to FESM2015 BUILD ERROR Could not resolve entry…
Abhishek
  • 621
  • 1
  • 8
  • 19
7
votes
1 answer

Yarn workspace isolation

I'm having some problems with yarn, on empty setups (when I do not have any versions of my libs on npm). I've a multi-module project as structured bellow: root # Yarn workspace * packages | * lib1-ws # Angular…
DTodt
  • 380
  • 6
  • 19
7
votes
3 answers

AGM angular Google Maps Set Zoom programmatically

I am working with AGM (Angular Google Maps) and OpenLayers. I need to set the zoom of my AGM programmaticly but haven't been able to figure out how it works. HTML Maps...
7
votes
2 answers

Pass configuration data to a dependency of a angular library using "forRoot"

I've created two Angular libraries, one has the other as a dependency. the dependency needs to be configured using the forRoot method. how can i pass the configuration data from the parent library to it's dependency? for example, let's say we have…
Roip
  • 81
  • 2
  • 6
7
votes
2 answers

Using NgRx (with ngrx-actions library) within an Angular 6 library

I am trying to split up an Angular application with multiple modules into multiple (separate) Angular libraries (using this guide), so I can use these libraries within multiple Angular applications. Currently the project has several modules, for…
7
votes
1 answer

Angular 6 / declare path for library in tsconfig.lib.json

I'm trying to configure the paths for an Angular 6 library (I have successfully configured the paths for a previous Angular project) Here is what is working for my previous app in the tsconfig.json file: "compilerOptions": { [...] "baseUrl":…
Savannah
  • 103
  • 1
  • 1
  • 5
7
votes
1 answer

Angular 2: Load different versions of the libraries based on the data

I have a requirement where I need to load different version modules based on the data. Something like monthly data, if some change happens in my module code for the current month, there shouldn't be any change in the view/logic from the previous…
6
votes
2 answers

Error: NG0203 when using RouterModule in Angular library

I'm trying to create an Angular v14 application that imports an Angular library that contains routing. My setup looks something like this: app.module.ts: (Main app) @NgModule({ declarations: [ AppComponent ], imports: [ BrowserModule, …
cube
  • 75
  • 6
6
votes
0 answers

Sharing AuthService data between shell & micro front end using module federation plugin - remote library

I have separate repositories for my shell & my microfrontends & I would like to share the auth service data between shell & microfrontends. I have used below article "Step 5: Share a Library of Your Monorepo" to create the AuthService shared…
6
votes
3 answers

Error: Cannot resolve type entity i10.BidiModule to symbol while building angular Lib project Angular 13

I am facing Error: Cannot resolve type entity i10.BidiModule to symbol while building angular Lib project. There are 2 other lib projects which are building fine. This new lib project works well without flex layout and material. But when I use flex…
6
votes
2 answers

Angular Workspace/Monorepo, forRoot giving me errors. "A value for 'forRoot' cannot be determined statically, as it is an external declaration."

I'm having a library called Themex. //envInjector.ts import {InjectionToken} from "@angular/core"; export const ENVIRONMENT = new InjectionToken<{[key: string]: any}>('ENVIRONMENT'); //themex.module.ts import {ENVIRONMENT} from…
harikrish
  • 2,009
  • 3
  • 19
  • 37
6
votes
1 answer

ngrx store selector failing on app import from custom library

I have an angular library with store implementation and this library is packaged as a NPM and used in different angular application. I'm trying to use a ngrx store selector which was exported in the library in my different angular project and the…
imPK
  • 764
  • 2
  • 7
  • 30