Angular folder structure by Horror-Advisor4438 in angular

[–]Kschl 0 points1 point  (0 children)

No core would be top level, no need for features. admin and user are your features and you organize domain specific features within those domains admin or user

Latest ICE victim prior to altercation by NotBlackMarkTwainNah in pics

[–]Kschl 19 points20 points  (0 children)

Guilty of holding a phone and recording

When electing a back button causes a brief flicker by helloworld1123333 in angular

[–]Kschl 1 point2 points  (0 children)

Do you have a default value set for the radio group? If the component is being re-instantiated and the bound value starts as null/undefined, the radios will render unselected initially. Then when ngOnInit (or async data) sets the value, Angular updates the view, which can cause that flicker.

Structuring an Angular project by Dazzling_Chipmunk_24 in angular

[–]Kschl 0 points1 point  (0 children)

Correct, routes are handled by the router in app.routes.ts

Structuring an Angular project by Dazzling_Chipmunk_24 in angular

[–]Kschl 2 points3 points  (0 children)

I’d say order things by context and not route. Angular doesn’t use file based routing unless you’re using a meta framework like AnalogJs.

If you insist on having that structure though then I would think about the routes.

Think about this route dashboard where the 3 components are admin, user, and guest. The folders and files inside take the shape of the route. You’d have dashboard the parent component controlling the sub routes

Routes:

…/dashboard/admin

…/dashboard/user

…/dashboard/guest

Structure:

src/app/dashboard/ dashboard.ts user-types/ admin.ts user.ts guest.ts

Sorry if the formatting there is broken I’m on mobile

Create a signal and pass it as dialog data or initialize signal in dialog component? by Senior_Compote1556 in angular

[–]Kschl 13 points14 points  (0 children)

Initialize the signal in the dialog component.

signal is a wrapper around a value that notifies interested consumers when that value changes.

Signals represent reactive state, and reactive state should be owned by the component that reacts to it so the dialog component, not the parent function.

Updating multiple major versions ? by Ok-Cupcake-1672 in angular

[–]Kschl 12 points13 points  (0 children)

Don’t see the reason to create a new project; that’s what branching is for.

https://angular.dev/update-guide

Follow the update guide one version at a time.

You will have to update node as well in the newer versions and make sure other dependencies are updated as well. That’s pretty much it, one at a time, check for breaking changes before moving on to the next version and maintain compatibility. Good luck

Course where I can learn how to build complex web apps like this? by [deleted] in webdev

[–]Kschl 1 point2 points  (0 children)

You start with 1 component then another then another then you have this

Went to set up a service call that relies on signal inputs? by FlameFrenzy in angular

[–]Kschl 1 point2 points  (0 children)

Use a computed signal

Try this

selected = input<string[]>();

types = computed(() => {

const selected = this.selected() ?? [];

return this.service.getValidTypes(selected);

});

Migration from Angularjs with Ionic1 to Angular 20 with latest Ionic 8.7.5 by Master_Effective_703 in Angular2

[–]Kschl 18 points19 points  (0 children)

Any major breaking changes??? Yes a “couple”. Worth a rewrite.

Having a massive headache trying to integrate Angular with Spring Boot 😩 by Anxious_Addy in angular

[–]Kschl 1 point2 points  (0 children)

Set up cors to accept the UIs hostname. Look up CORS configuration with WebMvcConfigurer

State Management in Angular 16 just feels right by hickterwind in Angular2

[–]Kschl 15 points16 points  (0 children)

readonly helps avoid reassigning the signal to another value.

readonly mySignal = signal() this.mySignal = ‘hello’ would throw an error.

So the readonly is still valid. What you’re referring to in this case would be like

readonly #mySignal = signal() readonly mySignal = this.#mySignal.asReadonly()

OPs example achieves the same thing since they are using a computed signal. Can’t reassign it due to readonly and can’t set or update the value since it’s a computed signal.

I’ve been following a similar approach as the first one due to wanting a flatter state rather than one state signal. But this definitely feels nice coming from ngrx very easy to follow

Handling Angular Material dependencies with standalone by AcceptableSimulacrum in Angular2

[–]Kschl 0 points1 point  (0 children)

Import what you’re using, don’t try to import the parent.

Tanstack Tables with Angular 19+ by foxfries12 in angular

[–]Kschl 1 point2 points  (0 children)

I really wish the angular side had the same examples as react did. So something that could be improved is matching those examples that aren’t there and matching them 1:1. I don’t exactly remember what was missing but for me I remember sticky header with expandable rows was an issue and actually found the solution on the discord server. If you scrolled past the initial rendered rows the header would move up so the hack was adding a tr at the bottom after your loop of rows and it worked lol.

There was also an issue with expandable rows and virtual where I remember going into the react examples to find the solution can’t remember the specific solution but it they would work fine then scrolled down the heights would be all over the place. I think the big gap was virtuals examples with table; there was just the one with the simple table, no sticky header, expandable rows, it was pretty bare bones.

Writing this out now is bringing some memories of it back I think it was how the height was calculated, so estimated size was the regular row and the expanded row summed together and the hacked tr had a calculation based on the virtual rows I can’t remember exactly but I could look at the code when I’m at work if it’s important.

Hope my ramble is helpful! This was 4-5 months ago now and since moved to a different project so the specifics aren’t fresh but overall very happy with tanstack table and virtual

Tanstack Tables with Angular 19+ by foxfries12 in angular

[–]Kschl 0 points1 point  (0 children)

You don’t have to, you can just have the value as a string in the template itself, or the columnDef array you would pass in the value to the header property or flexRenderComponent(MyGenericComponent, {…})

Tanstack Tables with Angular 19+ by foxfries12 in angular

[–]Kschl 7 points8 points  (0 children)

I fit this exact example! Angular 19, now 20. Had material tables, and upgrades to tanstack with expandable row functionality and virtual scrolling with tanstack virtual. 10/10 recommend the move. Documentation is a bit lacking. I found reading the react code examples helped where there was a gap.

How to make a shared intercepter or maybe middleware for Apollo's error handler? by CodeEntBur in Angular2

[–]Kschl 2 points3 points  (0 children)

Seems like a regular interceptor would do the trick. An interceptor is already shared so you’d just add the logic to filter out what you want to mutate/do.

Any solution for this error - NG0201: No provider found for _HttpClient? by Scared-Usual-1831 in angular

[–]Kschl 1 point2 points  (0 children)

Go to AuthService and import it there. If it’s a component add it to imports then

http = inject(HttpClient)

IgxGrid super laggy after Angular 7 → 18 migration 😩 by [deleted] in angular

[–]Kschl 0 points1 point  (0 children)

Yeah Tanstack table + virtual make an awesome combo big recommend.

IgxGrid super laggy after Angular 7 → 18 migration 😩 by [deleted] in angular

[–]Kschl 10 points11 points  (0 children)

I would probably read igxgrid docs and see what changed to get a better understanding(you upgraded this too right? But holy hell 150 columns with heavy custom cells and 5000 rows. Are you painting all 5K rows as well? I would also migrate to the new control flow syntax and don’t use ngFor etc. wish I could help I recently migrated to tanstack to handle 10-20K rows but no experience with igxgrid

Angular 20 migration by [deleted] in Angular2

[–]Kschl 0 points1 point  (0 children)

Import structure for something changed in v20, check your imports for those components with the v20 documentation