I have just started using LWC recently having normally coded front-ends in Angular of some sort. There are a couple of things that you don't seem to be able to do with LWC that seem to be really bloating my code, but I wondering if I'm just haven't come across the right way of doing things.
Objects can't be tracked
I'm used to getting a record from the server and assigning it to a single property in the component class, and then referring to a property of that object from the template, e.g.:
<my-component [some-attribute]="myModel.property"></my-component>
Whereas with LWCs, a separate tracked property needs to be created for each property of the model used on the template, and then transformed back into a single object on save etc. It seems very long-winded for scenarios with lots of properties.
There are no expressions
I've found that using template expressions in Angular is very handy way to cut down on code because a single property in the component class can be referenced in different ways, e.g.
<input name="account-name" [required]="stagePercentage >= 50" />
<input name="account-postcode [required]="stagePercentage >= 80" />
whereas for the same scenario with LWCs, two handler functions would have to be written in the controller:
<lightning-input required={stagePercentage50OrMore} />
<lightning-input required={stagePercentage80OrMore} />
and that is just a very simple scenario.
Have I missed any obvious patterns or ways of approaching this? Are there ways I could be reducing code here?
Thanks