Angular Required Input - It Is Still Bad

Angular Required Input - It Is Still Bad

Monsterlessons Academy

1 год назад

1,994 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

@akibmahmudrime2845
@akibmahmudrime2845 - 22.06.2023 17:32

Yeah, this required thing is stupid

Ответить
@PauloSantos-yu1tn
@PauloSantos-yu1tn - 22.06.2023 17:54

This was the first thing I noticed when I tried this required for the first time...

Ответить
@tobiaszciesielski
@tobiaszciesielski - 22.06.2023 18:04

For me, it totally makes sense. Even if you prove input in html template, this input could be from stream and first value from this stream could be undefined. You should check it anyway.

Ответить
@kumibrr
@kumibrr - 22.06.2023 20:55

Always felt hacky to use exclamation mark on inputs... I hope this gets fixed in coming RFCs.

Ответить
@AlainBoudard
@AlainBoudard - 23.06.2023 00:06

It's just sugar syntax and not really helping I think. Well we have good stuff anyway in latest releases, but thanks for pointing this out 👌

Ответить
@PhilMayfield-s5w
@PhilMayfield-s5w - 25.08.2023 20:32

I was hoping that the required prop on the decorator would prevent the child component from rendering until all required inputs had been provided a value, not just bound. You can for instance bind a required input to an uninstantiated Subject via the async pipe, and you'll get a null value.

Ответить