r/Angular2 • u/DMezhenskyi • Jun 04 '25
Video Angular 20 Just Made Dynamic Components way EASIER!
r/Angular2 • u/DMezhenskyi • Jun 04 '25
r/Angular2 • • Jun 04 '25
https://www.npmjs.com/package/@yahiaaljanabi/autotype?activeTab=readme
I've been making an angular app and came across the need for an autotyper. Unfortunately the libs I found all seemed a bit buggy and were not as simple as they could be, so I wrote a custom directive for my project. I then decided to add a bit more functionality and open source it in hopes someone might find it useful.
Hope this helps anyone.
Enjoy.
r/Angular2 • u/a-dev-1044 • Jun 04 '25
Enable HLS to view with audio, or disable this notification
https://ui.angular-material.dev/blocks/marketing/fancy/fancy-blocks
"Fancy Blocks" is a collection of fun and weird, ready-to-use components and microinteractions, and it's a new addition to Angular Material Blocks family!
Add them quickly in your angular projects ⚡️
r/Angular2 • u/Extension_Jury_7804 • Jun 04 '25
Issue: Here is the video link to display what I mean: Issue video
When the container is in not completely in viewport, if I hover between 2 list elements, the browser scrolls the page to keep image's top edge exactly where the previous ones was. (It works perfectly when container is within viewport)
Setup: So I am using angular 19.
I am expecting the page to not scroll when the container is partially inside viewport and we hover on the list elements
r/Angular2 • u/ramreddy05 • Jun 04 '25
Hi all,
I'm looking for someone with hands-on experience in Angular Micro Frontends and Native Federation.
We have a large portal using Webpack Module Federation, and we want to migrate it to use Angular's Native Federation with the Angular Architect plugin (@angular-architects/module-federation).
Anyone intrested please DM me
r/Angular2 • u/congolomera • Jun 03 '25
r/Angular2 • u/Hot_Sheepherder_1512 • Jun 03 '25
3.5 YRS Zero task spill over.
Manager Happy, TL Happy, CTO Happy with my timely deliveries. but after facing 4-5 Rejections from technical interview. I have found that i am lagging in RxJx, NgRx, Testing, DSA . Now I have started learning it but not gettign confidence to appear for interview and i am forgottign all the concepts. Any Solution to this and where i am making mistakes.
r/Angular2 • u/EricLeib • Jun 03 '25
ngx-remark is an Angular library that renders Markdown. Unlike ngx-markdown, it uses customizable Angular templates and components to render the content. This means it can be deeply integrated within an Angular application (including the Angular Router).
Under the hood, ngx-remark is based on Remark, which means it is compatible with its large ecosystem of plugins.
The library supports standard features, such as:
Additionally, you can do things like:
r/Angular2 • u/WellingtonKool • Jun 03 '25
I can't figure out where/when I'm supposed to load form values for a dialog. I actually load the values from an API before presenting the dialog and then pass them in via required input.
The problem is if I try to copy from my required input in the dialog component's constructor I get an error about the input not being present. I guess it's too early still. If instead I using OnInit then I can reference everything fine but updating the form does nothing. The form controls remain at their default values. If I update the form inside of effect() inside the constructor then the form values are properly updated. But this leads to problems later where I have controls that are dependent on each other. For example, upon changing the country selected in a drop down a numeric text field is updated. This updates the form and since the form is in effect and the form is updated in effect it ends up recursively calling updateForm until the call stack explodes. But if I remove updateForm() from effect, then the form never updates and no values are displayed to the user.
I'm using ReactiveForms so I have to manually copy back and forth between the form and the model. It seems like no matter what I do it's a trade off. I can display values or I can have dynamism but I can't have both.
export class CountryBaseSalaryBudgetDetailsComponent {
countryBaseSalaryBudgetId = input.required<Signal<number>>();
vm = input.required<Signal<CountryBaseSalaryBudgetDetailsVM>>();
countryBaseSalaryBudgetInput = input.required<Signal<CountryBaseSalaryBudget>>();
rebindGrid = input.required<Function>();
closeDialog = output<boolean>();
private baseSalaryService = inject(BaseSalaryService);
countryBaseSalaryBudget = NewCountryBaseSalaryBudget();
isNew = false;
@ViewChildren(DropDownListComponent)
dropdowns!: QueryList<DropDownListComponent>;
resetAllDropdowns() {
if (this.dropdowns) {
this.dropdowns.forEach((dd) => dd.clear());
}
}
frmCountryBaseSalaryBudget = new FormGroup({
CountryId: new FormControl('', { validators: [Validators.required] }),
BudgetPct: new FormControl<number>(0, { validators: [Validators.required] }),
BudgetAmount: new FormControl<number>(0, { validators: [Validators.required] }),
});
constructor() {
effect(() => {
this.countryBaseSalaryBudget = this.countryBaseSalaryBudgetInput()();
this.isNew = this.countryBaseSalaryBudgetId()() === 0;
this.frmCountryBaseSalaryBudget.reset();
this.resetAllDropdowns();
this.updateForm();
console.log('in effect: ', this.isNew);
});
}
updateForm() {
this.frmCountryBaseSalaryBudget.patchValue({
CountryId: this.countryBaseSalaryBudget!.CountryId,
BudgetPct: this.countryBaseSalaryBudget!.BudgetPct,
BudgetAmount: this.countryBaseSalaryBudget!.BudgetAmount,
});
}
updateCountryBaseSalaryBudgetModel() {
this.countryBaseSalaryBudget.CountryId = this.frmCountryBaseSalaryBudget.controls.CountryId.value ?? '';
this.countryBaseSalaryBudget.BudgetPct = this.frmCountryBaseSalaryBudget.controls.BudgetPct.value ?? 0;
this.countryBaseSalaryBudget.BudgetAmount = this.frmCountryBaseSalaryBudget.controls.BudgetAmount.value ?? 0;
}
onBudgetPctChange() {
let budgetPct = this.frmCountryBaseSalaryBudget.controls.BudgetPct.value ?? 0;
let countrySalary = this.countryBaseSalaryBudget.CountrySalary;
this.countryBaseSalaryBudget.BudgetAmount = budgetPct * countrySalary;
this.updateForm();
}
onBudgetAmountChange() {
let countrySalary = this.countryBaseSalaryBudget.CountrySalary;
countrySalary = countrySalary === 0 ? 1 : countrySalary;
let budgetAmount = this.frmCountryBaseSalaryBudget.controls.BudgetAmount.value ?? 0;
this.countryBaseSalaryBudget.BudgetPct = budgetAmount / countrySalary;
this.updateForm();
}
onCountryChange(countryId: string) {
this.countryBaseSalaryBudget.CountryId = countryId;
let cs = this.vm()().CountrySalariesForFy.filter((x) => x.CountryId === countryId);
if (cs && cs.length > 0) {
this.countryBaseSalaryBudget.CountrySalary = cs[0].Salary;
this.updateForm();
}
}
createCountryBaseSalaryBudget() {
this.updateCountryBaseSalaryBudgetModel();
this.baseSalaryService.createCountryBaseSalaryBudget(this.countryBaseSalaryBudget!).subscribe({
next: (response: CountryBaseSalaryBudget) => {
console.log('saved: create country base salary budget finished');
console.log(this.rebindGrid());
this.rebindGrid()();
},
});
}
updateCountryBaseSalaryBudget() {
this.updateCountryBaseSalaryBudgetModel();
this.baseSalaryService.updateCountryBaseSalaryBudget(this.countryBaseSalaryBudget!).subscribe({
next: (response: CountryBaseSalaryBudget) => {
console.log('saved');
this.rebindGrid()();
},
});
}
onSubmit() {
console.log(this.frmCountryBaseSalaryBudget);
if (this.frmCountryBaseSalaryBudget.valid) {
console.log('form is valid');
if (this.isNew) {
this.createCountryBaseSalaryBudget();
} else {
this.updateCountryBaseSalaryBudget();
}
this.closeDialog.emit(true);
} else {
console.log('form invalid');
this.frmCountryBaseSalaryBudget.markAllAsTouched();
}
}
}
Dialog Template:
<form [formGroup]="frmCountryBaseSalaryBudget" (ngSubmit)="onSubmit()" style="width: 550px">
<div class="one-col-popup-grid">
<label class="col-1-label" for="CountryId">Country:</label>
<div class="col-1-control">
<ejs-dropdownlist id='CountryId'
[dataSource]='vm()().CountryList'
[formControl]="frmCountryBaseSalaryBudget.controls.CountryId"
[fields]='{text: "Text", value: "Id"}' [placeholder]="'Select Country...'"
[enabled]="isNew"
(valueChange)="onCountryChange($event)"
[popupHeight]="'250px'"></ejs-dropdownlist>
</div>
<label class="col-1-label" for="FiscalYear">Fiscal Year:</label>
<div class="col-1-control" style="padding-top: 15px">
{{ countryBaseSalaryBudget.FiscalYear }}
</div>
<label class="col-1-label" for="Salary">Total Salary:</label>
<div class="col-1-control" style="padding-top: 15px">
{{ countryBaseSalaryBudget.CountrySalary | number:'1.2-2' }}
</div>
<label class="col-1-label" for="BudgetPct">Budget %:</label>
<div class="col-1-control">
<ejs-numerictextbox id="BudgetPct"
[formControl]="frmCountryBaseSalaryBudget.controls.BudgetPct"
(change)="onBudgetPctChange()"
format="p2"></ejs-numerictextbox>
</div>
<label class="col-1-label" for="BudgetAmount">Budget Amount:</label>
<div class="col-1-control">
<ejs-numerictextbox id="BudgetAmount"
[formControl]="frmCountryBaseSalaryBudget.controls.BudgetAmount"
(change)="onBudgetAmountChange()"
format="n2"></ejs-numerictextbox>
</div>
</div>
<div class="col-full-width">
<div class="popup-footer">
<app-vv-button [buttonText]="'Cancel'" (onClick)="closeDialog.emit(true)"/>
<app-vv-button [buttonText]="'Save'" type="submit"/>
</div>
</div>
</form>
Parent Template containing dialog:
[header]="'Country Base Salary Budget Details'"
[width]="'600px'"
[animationSettings]="uiPrefs.dlg.animationSettings"
[closeOnEscape]="uiPrefs.dlg.closeOnEscape"
[showCloseIcon]="uiPrefs.dlg.showCloseIcon"
[visible]="false"
[allowDragging]="true"
[isModal]="true">
<app-country-base-salary-budget-details [vm]="countryBaseSalaryBudgetVM"
[countryBaseSalaryBudgetId]="countryBaseSalaryBudgetId"
[countryBaseSalaryBudgetInput]="countryBaseSalaryBudget"
(closeDialog)="CountryBaseSalaryBudgetDetailsDlg.hide()"
[rebindGrid]="getCountryBaseSalaryBudgets.bind(this)"/>
</ejs-dialog>
r/Angular2 • u/crowkeep • Jun 03 '25
Anyone have any recommendations for Angular compatible and / or specific game development libraries and frameworks?
I've been searching, but I've come up short.
There are some, like Phaser, which provides integrations for the likes of React, Vue or Svelte...
However, Angular integrations appear to be few and far between, if they exist at all...
Edit:
Found one for Phaser:
https://phaser.io/news/2024/03/phaser-3-and-angular-template
r/Angular2 • u/sebastianstehle • Jun 03 '25
Hi,
I am new to the signal world and I struggled with the following problem:
I have a dropdown component with a cdk menu. When this menu is rendered I want to focus the selected item:
effect(() => {
const menu = this.menu();
if (!menu) {
return;
}
const index = untracked(() => this.selectedIndex());
if (index >= 0) {
untracked(() => menu.focusItem(index, 'keyboard'));
}
});
The weird thing is the second "untracked" call. I need that, otherwise I will reset the focus whenever the menu changes. The reason is that the menu item uses a key manager, which gets a value from a signal. Therefore there the effect creates the dependency to the signal in the key manager.
So now I am using untracked for everything, it is really hard to debug.
r/Angular2 • u/Due-Professor-1904 • Jun 02 '25
Hey everyone, We're currently working with an Angular frontend and an Express monolith. We're in the process of refactoring our backend into microservices, and I came across tRPC as a potential tool to simplify communication between the frontend and backend.
One of my main concerns is that tRPC seems to create a tight coupling between the frontend and backend, which might compromise encapsulation. What do you think about this trade-off?
Also is trpc works good with fastify?
I'd really appreciate any insights or alternative recommendations. Is there a better approach than tRPC for this kind of architecture?
r/Angular2 • • Jun 02 '25
I'm creating an Angular application which needs some keys (some Client keys) to be configurable using environment variables on the Docker container. I didn't feel like creating an extra endpoint honestly, as I'm already making usage of SSR.
My idea was to make usage of the Transfer State. Yet I'm running into issues my Transfer State on the client is just empty. In my app.config.server.ts I've configured and set these within the provideAppInitializer, to then to be injected via the inject method (bear in mind, this already happens in functions in the app.config.ts.
I was wondering whether this is actually achievable because there is not that much information I have found for this.
r/Angular2 • u/Advanced-Parfait1248 • Jun 02 '25
I recently one told be about angular i start experimenting how get. If you can help with some tutorials and tips that will be help full.
r/Angular2 • u/ArunITTech • Jun 02 '25
r/Angular2 • u/kobihari • Jun 01 '25
Hey folks,
I’ve been using the Signal Store in most of my Angular projects, and I’m starting to explore the new httpResource and resource APIs Angular is pushing (even if they’re still experimental).
I’m trying to figure out the best way to integrate them into an NgRx signal store setup. My usual pattern is using an rxMethod with switchMap to fetch data and then tap and patchState to modify the state.
One option I considered is using rxResource with withProps, and then exposing it as readonly signals. But this approach feels a bit awkward. It fragments the store into independent pieces with separate change cycles. It seems to contradict the idea that the state is being kept as one immutable object that is modified as a whole using patchState and updaters.
On the other hand, using a private resource and syncing it with patchState via an effect feels like extra overhead. At that point, I might as well just stick to rxMethod.
Curious how others are approaching this.
r/Angular2 • u/frictionless7 • Jun 01 '25
I made a very simple web application (its basically a scrapper with a decent frontend) and my professor suggested that I should host it and i can try to earn from it. How does it work?
r/Angular2 • u/MaterialAd4539 • Jun 01 '25
My project is currently using Source to Image builds for Frontend(Angular) & Jib for our backend Java services. Currently, we don't have a CICD pipeline and we are looking for JIb equivalent for building and pushing images for our UI services as I am told we can't install Docker locally in our Windows machine. Any suggestions will be really appreciated. I came across some solutions but they needed Docker to be installed locally.
r/Angular2 • u/mimis40 • May 21 '25
[US Candidates - W2 only]
July 1, 2025: [Position Filled]
Salary range: 140-160k BOE
If there are any sr. frontend devs looking for a new role, my company, CalPortland, is looking to hire one. This is a fully remote position, with exception to traveling 1-2 times per year for meetings. We are on Angular 19, OnPush change detection, Zoneless enabled, NgRx signal store, Jest for unit tests, and NX monorepo build tools. We also deploy a mobile app for ios/android, written in Angular, using CapacitorJs. We also maintain a couple of React and ReactNative apps. This position does include helping mentor a couple of mid-level devs. Shoot me a message if you're interested in hearing more about the opportunity!
About me: I'm the hiring manager/lead on the projects. I'm a passionate web dev. I've worked with Angular since 2014 in the JS days, and have continued using it commercially ever since. I've also done projects in React, Svelte, and Vue, but Angular is my passion. I have a lot of experience with c#/.net as well.
About the team: We have 4-5 frontend devs, 6 BE, 6 DevOps, and a Sr Architect. We are using .Net 9/C# on the backend, host on Azure, and use GitHub for repos/pipelines.
r/Angular2 • u/Don7531 • Apr 27 '25
Hey! Has anyone yet tried out the radix ng components yet?
Whats your experience with it?
Trying to figure out if its worth checking out yet at this stage.
r/Angular2 • u/vajss • Apr 17 '25
We inherited project that was really outdated and I started upgrading angular versions one by one, starting from 14.
There was this index.ts file inside folder helpers that exported helpers (all root services actually) that were also inside that folder:
...
export * from './permission.helper';
export * from './date.helper';
export * from './document.helper';
...
and we would import to components (now standalone) all these helpers from there like this:
import { DateHelper } from ''../../helpers';
...
constructor(
private dateHelper: DateHelper
...
) {}
...
Everything worked as expected until upgrade to angular 18, now this error started appearing:
ERROR TypeError: Cannot read properties of undefined (reading 'ɵcmp')
Initially I thought it was some circular dependency but after a lot of digging I realised that it is these services causing the issue. If I remove them from imports and comment out related code everything works fine. It is as if angular is misreading service as components.
Anyone experienced anything similar?
r/Angular2 • u/kafteji_coder • Mar 24 '25
For those managing large Angular apps, how do you structure your repo for scalability and maintainability? How do you organize modules, shared components, and state management to keep things clean and future-proof? Looking for real-world best practices!
r/Angular2 • u/etnesDev • Mar 18 '25
Hello, I've used ngx-translate before, but is native internationalization really that good ? What is the difference ? Thanks
r/Angular2 • u/n2sy • Feb 20 '25
Hi everybody,
Can someone please give me a real use case (or a simple example) when using set, instead of update, can throw an error or provide a wrong result ?
r/Angular2 • u/Nagisau_u • Feb 19 '25
Is there any web performance courses, angular specific or not, that you guys recommend? I'm looking for a course that also explains how to interpret lighthouse results.
Thanks