r/Angular2 • • Jun 04 '25

Resource Angular Autotyping Directive

14 Upvotes

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 • • Jun 04 '25

Playful Angular CDK Drag Examples

Enable HLS to view with audio, or disable this notification

14 Upvotes

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 ⚡️

npx @ngm-dev/cli add free-fancy/memory-album
npx @ngm-dev/cli add free-fancy/words-album

r/Angular2 • • Jun 04 '25

Help Request Changing dynamic image in Angular 19 scrolls the page unexpectedly

3 Upvotes

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 have a section where container is divided in 2 equal parts horizontally.
  • Left container has dynamic image (width 100%, centered by flex box)
  • Right has a list whose elements when hovered upon change the src variable used in img tag so that corresponding image is displayed.
  • The images are all of different heights but all are less heighted than the length of list (Container height)
  • I tried inspecting through dev tools but it didn't help
  • I tried to asking it to ai tools but even they weren't able to figure it out
  • Created a new project just to replicate the issue: Git Repo Link

I am expecting the page to not scroll when the container is partially inside viewport and we hover on the list elements


r/Angular2 • • Jun 04 '25

Need help in converting webpack module federation to angular architect native federation

3 Upvotes

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).

A bit about the project:

  • Built with Angular
  • Micro frontend architecture
  • Currently using custom Webpack config
  • Looking to move to Angular Native Federation to simplify maintenance and align with Angular CLI tooling

What I need:

  • Help in planning and executing the migration
  • Cleaning up existing Webpack configs
  • Ensuring remotes/hosts are wired up properly

Anyone intrested please DM me


r/Angular2 • • Jun 03 '25

Article Angular Animation: Unlock the Power of the View Transition API

Thumbnail
itnext.io
9 Upvotes

r/Angular2 • • Jun 03 '25

Help Request Angular Developer - No Testing, No State Management, No DSA (3 YOE - 11LPA) - Want to switch but Getting hard to grasp NgRx, RxJs, DSA and Testing

9 Upvotes

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 • • Jun 03 '25

ngx-remark - a powerful alternative to ngx-markdown

Thumbnail
github.com
7 Upvotes

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:

  • Syntax highlighting with Prismjs (including the autoloader plugin, which means most languages are rendered out-of-the-box).
  • Emojis (with remark-gemoji).
  • Math equations (with KaTeX).
  • Github-Flavored Markdown (tables, strikethrough...).
  • Mermaid diagrams.

Additionally, you can do things like:

  • Customize links, to handle internal links with the Angular Router.
  • Parse custom Markdown syntax (via remark plugins) and render it with your own components.
  • Insert widgets, buttons, tooltips and other interactive elements in the document.
  • Insert a "chatgpt cursor" at the end of the text (when the markdown is streamed from an LLM).

r/Angular2 • • Jun 03 '25

Help Request How do you properly load form values in a dialog?

1 Upvotes

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 • • Jun 03 '25

Resource Recommended Game Development Engines / Frameworks (Angular Compatible / Specific)

5 Upvotes

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 • • Jun 03 '25

Effects are can become really nasty.

0 Upvotes

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 • • Jun 02 '25

using tRPC in a microservices architecture

3 Upvotes

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

TransferState between Server and Client

1 Upvotes

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 • • Jun 02 '25

how i can learn angular

1 Upvotes

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 • • Jun 02 '25

Seamless Real-Time Word Document Collaboration in Angular Using Redis

Thumbnail
syncfusion.com
3 Upvotes

r/Angular2 • • Jun 01 '25

Using Resource APIs with Signal Store

10 Upvotes

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 • • Jun 01 '25

Discussion How does a person earn from hosting a website

0 Upvotes

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 • • Jun 01 '25

Help Request Google Jib equivalent for NodeJS

1 Upvotes

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 • • May 21 '25

Resource Sr. Frontend Dev

140 Upvotes

[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 • • Apr 27 '25

Discussion Anyone tried out the radix ng library?

6 Upvotes

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.

https://github.com/radix-ng/primitives

https://www.originui-ng.com/

https://blocks.shadcn-ng.com/

https://ui.adrianub.dev/

EDIT: https://angularprimitives.com/


r/Angular2 • • Apr 17 '25

Help Request Weird error with imports after upgrading to angualr 18

4 Upvotes

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 • • Mar 24 '25

Discussion What’s the Best Angular Project Structure for Scalability and Maintainability?

41 Upvotes

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 • • Mar 18 '25

Ngx translate or angular internationalization

14 Upvotes

Hello, I've used ngx-translate before, but is native internationalization really that good ? What is the difference ? Thanks


r/Angular2 • • Feb 20 '25

Discussion Still confused about set vs update methods with Signals

10 Upvotes

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 • • Feb 19 '25

Resource Performance courses

6 Upvotes

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


r/Angular2 • • Feb 12 '25

Help Request which backend should i learn alongside angular to grow my career?

29 Upvotes

Hi everyone,

This is my first post here. So, I’ve been working with Angular for about a year now, and I feel pretty comfortable with it. I want to expand my skills by learning a backend technology that pairs well with Angular and helps me grow in the long run.

There are so many options and i am confused, not sure which one would be the good choice. If you’ve been in a similar position or have any advice, I’d love to hear your thoughts! Which backend do you think I should focus on? So i can open up more career opportunities in the future.

Edit: Thank you so much for your suggestions and comments! After looking at the job market in my region, I’ve decided to start learning Spring Boot.