660 questions
0
votes
1
answer
165
views
Angular standalone components library and NGRX slices
I'm migrating an application to standalone components using the following:
ng generate @angular/core:standalone
I've already migrated every component to standalone. I now need to remove unnecesary ...
1
vote
1
answer
53
views
Functional style interceptors - How to provide them with dependencies
Imagine the situation where you provide any lib to client. Simple scenario, spinner interceptor which needs spinner service.
In old way it was possible to:
providers: [
{
provide: ...
1
vote
1
answer
72
views
In Angular 12, how do I ship my library's assets?
I have a standard Angular 12 library workspace that I created through "ng generate library my-lib".
my-lib has a component that shows an image asset.
My consumer app uses my-lib component ...
1
vote
1
answer
227
views
Angular Library Routing Not Working When Used Inside Angular 19 App
I'm working on an Angular 19 app that uses a custom Angular library, and I'm having trouble getting the routing inside the library to work properly.
The app is a legacy app and all the components are ...
1
vote
1
answer
324
views
How to handle module imports specific to a library in an angular standalone app?
I have a library material-extension inside my angular workspace, in which I'm creating some components I require but Angular Material is lacking. In this extension I've installed the module ngx-editor,...
0
votes
2
answers
621
views
How to import font assets?
I am trying to create an Angular 19 library with a personalized fonts linked directly into a global SCSS file.
On build time, I have the exact same error being raised by builder:
src/lib/label/label....
3
votes
0
answers
224
views
Angular 17 Library build size is too large (40MB)
I have made an Angular 17 library that I want to publish, but I have noticed that one file in particular in my build is very large.
My dist folder has a fesm2022 directory, which contains an .mjs file ...
2
votes
2
answers
447
views
Using input Signal in Angular Library
When using an Angular (19) Library project within another Angular 19 Application project (these are separate projects) using npm link, I get following runtime error when building the application for ...
1
vote
2
answers
76
views
How to use a service from a library project, which has some dependecy like toastr, in another angular library project
I have a one service in my library project which have dependency on toastr in my angular project
import { Injectable } from '@angular/core';
import { ToastrService } from 'ngx-toastr';
import { ...
0
votes
0
answers
40
views
Angular Multi Library in a Workspace
In order to manage my own projects better in Angular, I will create some libraries named ngx-suffa in the workspace.
Each library will be under the same workspace.
For example:
@ngx-suffa/core, @ngx-...
2
votes
1
answer
169
views
Troubleshooting NG0203 Error: Issues with Angular Library and HttpClient Injection in Production Build
I wasn't able to solve it. I'm counting on your help.
I have an Angular application and a library.
In the library, I have a service where I inject HttpClient. I set HttpClient as a provider in the ...
1
vote
1
answer
52
views
How to maintain module level theme mixins css files while creating angular library?
I am creating angular library which exposes most of the feature
modules along with global css.
The global CSS file again imports CSS files which contains theme
mixins for each modules as follows:
...
1
vote
1
answer
200
views
How to copy the README.md file, inside an angular project before publishing it to npm
I've created a library with Angular libraries
This is my pretty default project structure
- README.md
- package.json
- angular.json
- projects
- my-project
- ng-package.json
- package.json
...
-1
votes
2
answers
48
views
Angular Singlton Generic Service with dynamic return type
i have this event management service in my angular application.
i want to set the return type of the OnEvent() method dynamiclly and i want to set the type where i inject the service in my components.
...
0
votes
0
answers
243
views
Angular 18 Library & Showcase - ng test doesn't find Spec files
tldr; Trying to determine why running ng test library is returning Executed 0 of 0 SUCCESS.
I have an Angular Workspace setup with two projects:
Workspace
Projects
Library
Showcase
The Library ...
1
vote
1
answer
489
views
Angular library secondary entry points that reference each other , use via npm link
All the examples I find for developing libraries in Angular always have the library in the same workspace as the app, but I can't do so.
I have three different Angular 18 workspaces, one for libraryA, ...
0
votes
1
answer
71
views
Migrate Angular functions to common library
Our Angular project has evolved to have a bunch of functions that don't really belong in any class (in addition to all the normal classes of course). We now need a new Angular project that wants to ...
1
vote
1
answer
1k
views
How to Change dist Directory Structure After NX Build for Angular Publishable Libraries
I'm working on an NX Angular application with multiple publishable libraries. Currently, after running nx build, the dist directory has the following structure:
current:
dist
└── libs
└── ui-kit
...
1
vote
2
answers
1k
views
Angular library gives me injection errors with HttpClient
I am trying to build a simple library in Angular (version 18) that can be used in my application and Angular Elements component.
The idea is simple in both the application and element: Get the same ...
0
votes
0
answers
41
views
How manage 3rd party libraries while creating angular libraries
I have been building multiple libraries in angular, say X, Y & Z. And they will be loaded in the main app. These different libraries can have different node modules depending on the feature of ...
0
votes
1
answer
278
views
How to integrate icons into an angular library?
I would like to integrate an SVG icons into my angular library's template, and I have the following questions?
Where should the /assets folder be located? Should it reside under /src or /src/lib ...
1
vote
1
answer
108
views
Using apps theme css variables in library
I have created an angular library and I would like to use the apps primary material color in my libraries css.
An application can define a primary color, assuming $app-primary is defined in my apps ...
1
vote
0
answers
329
views
How to use TailwindCSS with Angular Libraries
I have a Angular library who use TailwindCSS. This library has the theme with the plugins configured with components to shared with another microfrontends.
I export from the library all the components,...
1
vote
0
answers
186
views
Use assets from node_modules in a library
I have a NX Monorepo, and in an angular library (Lib_A), I would like to access assets from the node_modules. Now normally one could add the assets to the project.json of the app itself. However, in ...
1
vote
0
answers
126
views
Angular Libraries: 'rootDir' is expected to contain all source files
A question, I don't know if this happens to anyone, I don't know how to fix it.
From an entry point (a component) I want to import the model of the other, but I get the error:
File is not under '...
0
votes
1
answer
205
views
provide http interceptor via a provider function
In my library, I export a http interceptor.
Currently to activate the interceptor, the user must use the following code:
import { provideNgProgressHttp, progressInterceptor } from 'ngx-progressbar/...
0
votes
0
answers
85
views
Angular library build failing
I have an Angular 17 project which is acting as a test project so I can build and test components from an Angular library which will get built and used amongst various other projects.
My folder ...
1
vote
1
answer
693
views
How to bundle standalone component and directive when building an Angular library
I have built an Angular library that contains a component and a directive which are intrinsically linked. That is the component uses the directive. Everything works fine other than to successfully use ...
1
vote
1
answer
831
views
angular custom package missing specifier
I have created an angular custom package (angular 17.3) in which there is a service.
After publish, I install the package and am able to see the service. But I have en error
An unhandled exception ...
1
vote
1
answer
157
views
How to Override a Component from a 3rd Party Library in Angular?
I'm using an internal library that provides a generic solution for authentication, including a login page with a login form. For a specific application, I need to customize the login form by adding ...
1
vote
1
answer
41
views
How to bootstrap angular library from the angular application
I am having a angular library in npm repo. Installed that library in another angular application.
Do we have any direct options to bootstrap the remote angular library from the main project? Need to ...
0
votes
2
answers
58
views
How can we use the langular ibraries @angular/common, @angular/core etc from the dependency? [closed]
I have a angular library installed in my angular application. So the library has all the angular dependencies such as @angular/common, @angular/core etc.
I want to use a single version of angular ...
2
votes
1
answer
2k
views
Angular Library Exporting Standalone Components
I created an Angular library with a standalone component:
import { Component } from '@angular/core';
@Component({
selector: 'app-form-error',
standalone: true,
imports: [],
template: `
<...
0
votes
1
answer
178
views
Publishing an Angular library with an external dependency
I'm writing an Angular library that includes functionality from an external dependency.
For the sake of this example, the library includes a service class that uses axios to fetch data.
When I publish ...
2
votes
1
answer
235
views
Angular APP_INITIALIZER in library is not called
I had an angular application with APP_INITIALIZER in app.module.ts, where I loaded from a REST API all lists that I use in the combo-boxes, and that worked fine. I moved all my components to a library,...
1
vote
2
answers
2k
views
Use image asset in angular library
I have a couple custom libraries that I load dynamically at runtime based on configuration. I can use assets in an angular application, however this does not work in my library.
Dependency in my ...
1
vote
2
answers
195
views
Primeng 12 Angular 12 Custom library: Error Symbol Fieldset declared in .... is not exported from primeng/fieldset after compileOnSave
I'm having headache with primeng and angular, it all happens when I add primeng to my Angular's library (It's already installed in main project). After building both library and main project and ...
1
vote
1
answer
1k
views
Angular does not update the UI after form control is marked as dirty and touched
I am marking the form control as touched and dirty in my action and the change is not being reflacted on the UI.
I am using signalSlice from the ngxtension library:
https://ngxtension.netlify.app/...
2
votes
1
answer
191
views
How to consume Custom pipe defined in a angular library?
I am facing issue while importing a custom pipe from angular library to main app.It is a custom library and I am using static forroot approach to load the library's module.I have declared and exported ...
1
vote
1
answer
3k
views
Running Jest tests in an angular library on Nx Monorepo
I've an nx monorepo project that have the following structure
apps/
libs/
- angular/
|- projects/
|- angular-components/
|- src/
|- lib/
|- componentA/
|- tests/ ...
2
votes
1
answer
2k
views
How to add lucide-angular to the standalone Angular app?
I want to add lucide-icon package to my standalone Angular app. Accroding to it's document it's availabe for the Angular module but I'm using standalone mode, so how to add this package to the ...
1
vote
1
answer
1k
views
Angular 17 library : add @angular/localize
I'm creating a new Angular 17 application. Some others will be created afterwards. So I want to create a library with main layout to be able to share it between all my applications.
As the application ...
1
vote
1
answer
680
views
Making sure my Angular library's service is constructed offering standalone friendly provide function
I am authoring an Angular library. It contains a service, which runs initialization logic in the constructor that is required for the library to work properly. I have set up the library module with a ...
1
vote
1
answer
318
views
Use templateUrl from an external library in Angular
In my angular 15 app I have many components that use the same template, by referencing to the same template file in TemplateUrl.
for example:
@Component({
selector: 'app-my-comp',
templateUrl:'../....
1
vote
1
answer
877
views
Angular library include external library [duplicate]
I am trying to include several dependencies in my library (ex. dashjs, leaflet, ...).
I know how to include it in a standard Angular project. Add dependencies to package.json and add each external ...
1
vote
0
answers
46
views
Circular dependency issue within Angular Library
I am facing an issue with Angular circular dependency. To explain, I have a component let us say DynamicForm Component, which utilizes a directive (dynamicField). The directive in turn creates ...
0
votes
1
answer
100
views
Implement a shared service between a library and an Angular consumer
I have a shared service between the different modules in my Angular application and I have implemented an Angular library. I want to use the shared service in the library too, i.e. if a data is ...
0
votes
1
answer
131
views
Angular - for loop to generate data for a tag cloud
I am new to angular. I am trying to generate a tag cloud.
I can generate the tag cloud but however the list of words I receive is dynamic from an api response.
So I wanted to create a for loop that ...
0
votes
1
answer
270
views
How to use a fork library in Angular 14
I'm trying to migrate to Angular 15, but this library is blocking me:
https://github.com/merlosy/ngx-material-file-input
This issue is talked about here (update to Angular 15):
https://github.com/...
0
votes
1
answer
248
views
Angular 13 package throws error "moment is not a function" when imported into a Angular 13 project
i'm upgrading a private library (privLib) to Angular 13, so i can migrate all other projects, but when imported into a project one of the services uses moment and throws an error: "ERROR ...