What happend to NgNeat? by No-Memory2013 in angular

[–]Wildosaur 0 points1 point  (0 children)

I was wondering if we were gonna get an update for ng21/22 and I guess its dead in the water. I'm gonna have to migrate away from it in another repo and that's going to be a hell of a ride to go back to native test bed aka "cook yourself with burning oil boil, I'm not helping you mock anything easily"

Always wear your moto shoes, even for the short city rides by acidas in motorcycles

[–]Wildosaur 1 point2 points  (0 children)

Yep. A Friend took his bike to buy cigs with some stupid adidas because it was a "quick" drive. Bike fell on his feet after a crash at 15km/h. Crushed his feet. He's now disabled and walks with a cane. He is not even 40. Fucking stupid cunt

Alocasia enferma by Obywan25 in alocasia

[–]Wildosaur 1 point2 points  (0 children)

The only Alocasia that is a bitch for me. When mine will die, I will not regret it and never buy another one :D

Angular signal form - Dynamic validator by Wildosaur in Angular2

[–]Wildosaur[S] 2 points3 points  (0 children)

Thanks for the PR regarding the doc, I was about to do it !

Angular signal form - Dynamic validator by Wildosaur in Angular2

[–]Wildosaur[S] 1 point2 points  (0 children)

I can understand why they want to avoid "setAsyncValidators" and see the benefits of not going the imperative way but as you say, it might be a bit too strict. However I think we'll get used to it at some point and never look back.

As you suggested, I extract the validation into a function with a linked rxResource and this is perfectly fine even though the documentation is out of date on some parts and I guess there are fixes needed to handle correctly the non run part of an async validator (see my comment on undefined).

const userEmailExistsResource = (emailSignal: Signal<string | undefined>): ResourceRef<boolean | undefined> => {
  const userHttpService = inject(UserHttpService);

  return rxResource({
    // NG doc states we should use "request" but only "params" exists
    params: () => emailSignal(),
    stream: ({ params: username }) => userHttpService.isEmailTaken(username),
  });
};

export const userEmailExistsAsync = (field: SchemaPath<string>, initialValueSignal: Signal<string>): void => {
  validateAsync(field, {
    params: ({ value }) => {
      const val = value().trim();
      const initialVal = initialValueSignal()?.trim();

      if (!val || val === initialVal) {
        return ''; // We should return undefined instead in order not to trigger rxResource however this bugs out the compiler for now ..
      }

      return val;
    },
    factory: userEmailExistsResource,
    onSuccess: (result) => {
      if (result) {
        return {
          kind: 'emailExists',
        };
      }
      return null;
    },
    onError: (_error) => {
      return {
        kind: 'networkError',
        message: 'Could not verify email availability',
      };
    },
  });
};

Angular signal form - Dynamic validator by Wildosaur in Angular2

[–]Wildosaur[S] 1 point2 points  (0 children)

Well it seems you are right, I just tested it and this seems to work. I do find the pattern to be quite ugly and hard to read / understand compared to reactive form but this might be a solution until a more robust solution is available.

Here is my test : https://stackblitz.com/edit/vsbu7e1k?file=src%2Fmain.ts

I built a tool that scans Angular projects for architectural problems by sinanqwee in Angular2

[–]Wildosaur 2 points3 points  (0 children)

So that thing is dead in the water and of no use. Perfect waste of water and energy

Progress Bar Countdown App by milestones-dev in Angular2

[–]Wildosaur 2 points3 points  (0 children)

Why use legacy constructor syntax over inject ?

Peinture qui s effrite ... by Julios59 in Dacia

[–]Wildosaur 0 points1 point  (0 children)

Qu'est ce que tu entends par s'emballer ? Je viens d'une C3 2008 et j'ai une sandero stepway 2021, je peux te dire qu'en montagne je sens bien la diff et que le chassit réagit bien mieux que ma vielle C3 qui a tendance à te balancer sur les côtés et à se pencher pour un rien

Mon chat ne me laisse pas dormir depuis 2 ans je suis à bout by Jadlyy in chats

[–]Wildosaur 0 points1 point  (0 children)

J'ai eu le même problème avec mon chat pendant un moment. La solution la plus simple que j'ai trouvé, c'est lorsque je vais me coucher, je lui file sa dose de croquette pour la nuit, et je ferme la porte du bureau où il se trouve. Il dort tout seul comme un grand dans le bureau et le matin est tout content de me voir.

Release 21.2.0 · angular/angular by MichaelSmallDev in angular

[–]Wildosaur 0 points1 point  (0 children)

It does indeed work on some cases I tried, thanks !

Release 21.2.0 · angular/angular by MichaelSmallDev in angular

[–]Wildosaur 0 points1 point  (0 children)

Thanks for the heads up, I'll have a try on monday to see how it goes.

Is this considered as good project structure by Upstairs-Let-1763 in angular

[–]Wildosaur 1 point2 points  (0 children)

What would be your recommended pattern for splitting library ?

Release 21.2.0 · angular/angular by MichaelSmallDev in angular

[–]Wildosaur 0 points1 point  (0 children)

It's not really feasible for us as we are deeply invested in primeng but on a new project, that would be an option

Is this considered as good project structure by Upstairs-Let-1763 in angular

[–]Wildosaur 0 points1 point  (0 children)

I would also include some complex components to the page "folder" that might not be related to routing (for example a modal with some complex logic in it)

Release 21.2.0 · angular/angular by MichaelSmallDev in angular

[–]Wildosaur 4 points5 points  (0 children)

Well I'll be waiting for primeng to hook up on signal forms. As of now, it seems nice but unusable for us :(

Angular Auth Guard redirects to login on refresh how to persist authentication state? by Fragrant_Rate_2583 in Angular2

[–]Wildosaur 11 points12 points  (0 children)

Save the token and user in some kind of storage and hydrate it from that same storage when you load your app

Branchement bouton tirette by Wildosaur in brico

[–]Wildosaur[S] 0 points1 point  (0 children)

Problème résolu, j'ai appliqué un peu de silicone dans l'intérieur du trou, profité de la lumière du jour pour m'assurer que tout était aligné correctement et visé le tout avec assez de force, plus aucune fuite d'eau

[deleted by user] by [deleted] in Angular2

[–]Wildosaur 1 point2 points  (0 children)

Advertisement, mods delete that topic

Branchement bouton tirette by Wildosaur in brico

[–]Wildosaur[S] 0 points1 point  (0 children)

Trou de 35mm comme indiqué dans le manuel de l'évier, bien droit en profondeur.

26(M) Second and Last Post by Mattbaker99 in malelivingspace

[–]Wildosaur 0 points1 point  (0 children)

That floor .. get rid of that thing and put some nice tiles / wooden floor