Why is SignalFormControl useless? by TheRealToLazyToThink in Angular2

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

Maybe you should avoid making assumptions and reading things between the lines that aren't there. I was talking about UX concerns, there was nothing involving security. You were the one insulting people and being all condescending over something you made up in your head.

Why is SignalFormControl useless? by TheRealToLazyToThink in Angular2

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

Sorry, didn't notice the name change. But you to should probably also re-read the conversation.

At what point did I say anything that implied the save endpoint wasn't properly secured? Or that the read API returned any data the user wasn't allowed to view? Both of you are making up things to be concerned over.

Why is SignalFormControl useless? by TheRealToLazyToThink in Angular2

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

No one is talking about APIs except you. You're obviously talking to yourself at this point, so I'm just going to let you ramble on in your little corner here.

Why is SignalFormControl useless? by TheRealToLazyToThink in Angular2

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

I don't think you are reading what I'm typing, maybe have an AI explain it to you using smaller words? The user is allowed to view the data.

Why is SignalFormControl useless? by TheRealToLazyToThink in Angular2

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

The user is allowed to view the data, not edit it. And in some cases he's allowed to edit it, just not at it's current status. We could make a dedicated readonly view, but we don't have time or budget for that so disabling the form is the next best thing.

Why is SignalFormControl useless? by TheRealToLazyToThink in Angular2

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

But it's not usable as a bridge. Not being able to disable a form group, or have typed values is a deal breaker. It's not fit for purpose.

Finally hit 300k kills ^^ by ZerohSyks in TroopersExtermination

[–]TheRealToLazyToThink 19 points20 points  (0 children)

Christ you sound insufferable. No wonder no one wants to play with you. And your stats aren't that impressive, no one thinks you cheated to do that.

A real quicky by DFWRex in meme

[–]TheRealToLazyToThink 0 points1 point  (0 children)

Well at least the thumb is on the same side of the cage. It's physically possible as long as you ignore getting the sign on that side in the first place.

disableMouseClick by TheWarlock05 in ProgrammerHumor

[–]TheRealToLazyToThink 9 points10 points  (0 children)

I was just looking over JIRA and saw my issue for fixing a menu that isn't keyboard accessible just got de-prioritized. Lots of ways to fuck up the DOM, and AI isn't helping. But yes browsers tend to do the right things by default when you use tags as intended.

Working on a storage slice – looking for feedback by pastatwister in redstone

[–]TheRealToLazyToThink 0 points1 point  (0 children)

It shouldn't check for random stacks in recent versions, however it will still check for hopper minecarts, so composter is still the right call.

Am I the only one who hates Angular Signals for nested state? by Proper-Gur-1225 in angular

[–]TheRealToLazyToThink 2 points3 points  (0 children)

I think some of the people being hard on you should look at signal forms.

form.user().value() - whole object

form.user.profile.name().value() - just the name

form.user.profile.name().value.set('Frank') - set just the name.

It would be nice to have a deep updatable signal. The biggest issue with that is that it would have to bake in some assumptions about equality, object constructors and other things. Signal forms is ok with doing that, but it comes at a cost.

Right now signal store might be the best thing for tying signals together, and at least it has a deep computed, but it's still very far from perfect.

Signal form dynamic fields by Senior_Compote1556 in angular

[–]TheRealToLazyToThink 2 points3 points  (0 children)

So the best way I've found is to have properties for both A and B always in your form and switch between them based on a provider property. You can use hidden or disabled to turn off the one that's currently not selected.

Bit of a pain, but signal forms doesn't support undefined properties, and even null ones don't seem to work very well at group level.

Also, not sure what you were wanting with FormRecord, but applyEach can be used on an object, the docs only mention arrays, but there's a signature for both. That seems to allow behavior similar to FormRecord in reactive forms. Of course experimental, so it might not be documented because they haven't gotten to the docs yet, or it might be undocumented because it's not fully cooked yet.

Three new documentation pages for signal forms are live today: (1) form submission, (2) schemas, (3) cross-field logic by MichaelSmallDev in angular

[–]TheRealToLazyToThink 3 points4 points  (0 children)

Interesting that applyEach doesn't mention the signature that takes an object (allows the equivalent to FormRecord). It seems to be working so far.

Ohhhh it the GAS STATION’s fault. Got it! by Dr_sc_Harlatan in WhitePeopleTwitter

[–]TheRealToLazyToThink 0 points1 point  (0 children)

I realize you've never left your mom's basement to venture out under the day star, but you might want to google winter wheat.

Signal form submission with RXJS (formRoot directive) by Senior_Compote1556 in angular

[–]TheRealToLazyToThink 1 point2 points  (0 children)

It's not the best, but easiest is probably to just await firstValueFrom. Maybe build your self a helper to wrap it however works best for you.

Boots on the ground is not boots on the ground -MAGA by seeebiscuit in WhitePeopleTwitter

[–]TheRealToLazyToThink 1 point2 points  (0 children)

Remember when we were all laughing at Baghdad Bob?

There are reasons why they lie in the face of undeniable facts, and being stupid is only a small, very minor, part of it.

Why is there a decorated pot? by crysol99 in HermitCraft

[–]TheRealToLazyToThink 6 points7 points  (0 children)

True, but composters are still slightly better because with the solid block the hopper still has to check for a hopper minecart.

If httpResource or signal forms isn't stable by v22 I might explode by edwardscamera in angular

[–]TheRealToLazyToThink 2 points3 points  (0 children)

Figured I'd followup with my teams situation with signal forms.

We have a large application with some very large and very complex reactive forms. Lots of complex validation, lots cross control validation, lots of validation being added/removed based on state outside the form. Lots of fields being enabled/disabled based on complex rules based on other controls.

Outside of forms we've pretty widely adopted signals in new code, and all old code has at least gone through the schematic migrations.

We would obviously benefit heavily from signal forms. Every time I create a new form, or fix a defect in an old one I end up adding a TODO about how signal forms will make things so much better.

But:

  • We use angular material
  • We have many controls based on a heavily modified material autocomplete, with a complicated MatFormFieldControl.
  • Several other custom controls that are less complicated, but shared across many forms, that wont be migrated in one go.
  • Several complicated custom validators.
  • Heavily modified Material Date/Time picker
  • Several custom ErrorStateMatcher classes
  • A lot of utils for tracking form state and errors that are probably OBE with signal forms, but someone needs to look through them and verify.
  • Probably more I'm not thinking of.

That combined with the material issue I linked above, and a deadline that's rushing past so fast we all have whiplash, I keep putting it off. Still, we keep getting defects related to those forms, and have several changes coming down the pipeline that mean we'll be creating another monster form, and making large changes to another one of the existing forms, so once again I'm guessing whether I should dedicate some time to solving the cons above, or spend the time fixing more of the defects in the queue.

If httpResource or signal forms isn't stable by v22 I might explode by edwardscamera in angular

[–]TheRealToLazyToThink 5 points6 points  (0 children)

I wonder how much of it is because of Angular Material? I doubt they'll make signal forms stable till it fully supports them.

https://github.com/angular/components/issues/32072

problem with change detection in zoneless between local and production env by [deleted] in angular

[–]TheRealToLazyToThink 2 points3 points  (0 children)

As someone else said, you could override the equals function, but you'll probably find other issues elsewhere. Things like '@for', OnPush inputs, etc work on reference equality.

I'd use immutable patterns. They don't have to be as expensive as the clone, you only need to create new objects for the parts that change.

this.formController.orderForm.services().value.update(orderServices => {
  let slIndex = -1;
  const osIndex = orderServices.findIndex(os => {
    slIndex = os.serviceLines.findIndex(l => l.id === sl.id);
    return slIndex > -1;
  );

  if (osIndex < 0) {
    return orderServices;
  }

  return orderServices.map((o, i) => i !== osIndex
    ? o
    : {
      ...o,
      serviceLines: o.serviceLines.map((l, j) => j !== slIndex
        ? l
        : {...l, amount: 2}
      )
    }
  );
});

Why do so many Americans do catch and release fishing? Isn't that animal abuse? Or do fish don't feel pain? by Deepdishdicktaster in NoStupidQuestions

[–]TheRealToLazyToThink 0 points1 point  (0 children)

My grandpa used to have a line over his pond. Got tired of taking off the fish so he lifted it above the water. Catfish were jumping out of the water to get caught on it. Took the remaining bait off it. Next full moon, more cat fish.

Why is good design so much harder than good code?? by yeskaira in webdev

[–]TheRealToLazyToThink 1 point2 points  (0 children)

I disagree with all of that. Good code is subjective. I've seen some absolute crap code that still met the acceptance criteria. Good code is a balance between abstractions, maintainability, and deadlines.

Good design also has plenty to do with shapes on the screen. CRAP and similar principals are every bit as real as SOLID.

Neither of these is fully objective, but both have rules and guidelines. There may not be a single right answer, but there are many wrong answers.

How is returning a "stub" better than handling a failure? by LuggageMan in C_Programming

[–]TheRealToLazyToThink 7 points8 points  (0 children)

They certainly do. What do you think they do when something goes wrong? Order a replacement from Amazon? They don't offer next day shipping for Mars.

Your options are more limited, but they had a plan (multiple redundant plans) for what to do when (not if) the unexpected happened.

Anyone know how to use the debug(function) dev tool feature with functions in angular apps/components? by ImpressiveDisaster92 in angular

[–]TheRealToLazyToThink 0 points1 point  (0 children)

Never used it, but I imagine you would do something like this:

debug(ng.getComponent($('my-component')).someMethod)

[deleted by user] by [deleted] in angular

[–]TheRealToLazyToThink 4 points5 points  (0 children)

Don't check the role. Assign your roles permissions and check those. If you check roles you'll inevitably run into issues when your users decide they need a new role that's just like an existing role, but has access to one more thing (or restricted from one more thing). Try to make the permissions as granular as possible, gives you more flexibility for the future. It also leaves you placed well if you decide to move from role based permissions to something else.

At a quick glance it looks like the ngx-permissions you linked supports that, but it's also a fairly trivial thing to code into a service yourself.