News for hackers. Stuff that matters.
Re:Google: Angular and Wiz Are Merging by chuckadams on Thursday March 21, 2024 @09:02AM (#39777993)
The template syntax of Angular isn't the problem most people have with it. It's the boilerplate, the forced OOP paradigm, having to work with observables even when they're not appropriate (thus having to understand "hot" vs "cold" observables), and up until recently, having to scatter each component across three different files. And to top it off, when the lack of expressivity is touted as a feature for taming complexity, that points to a development culture that doesn't sit well with me either.
Re:Google: Angular and Wiz Are Merging by tashoecraft on Thursday March 21, 2024 @09:27AM (#39778256)
You have literally never had to scatter each component across three files. From the first release of Angular 2, you had "single file components", with template, styles and js all in one file.
Re:Google: Angular and Wiz Are Merging by chuckadams on Thursday March 21, 2024 @10:39AM (#39779022)
It does appear I was wrong about the "until recently" bit: Angular still doesn't have a single-file component format like Vue or Svelte. Of course you can stick templates in string literals (and IDEA will even treat them as angular templates). Just be prepared to escape your quotes I guess. The official tutorial still uses separate files, and the tooling defaults to them too.

Honestly the real shame is that IDEs don't present a more integrated UI for separate files, and that on the other hand in my Vue apps I still have to argue over the order of script/template/style sections. I guess Angular at least avoids that second problem.

Re:Google: Angular and Wiz Are Merging by usui on Thursday March 21, 2024 @10:45AM (#39779110)
Isn't dealing with bare string literals for HTML-like syntax a terrible developer experience?
Re:Google: Angular and Wiz Are Merging by chuckadams on Thursday March 21, 2024 @10:59AM (#39779321)
Not as much in Jetbrains IDEs: it detects the string is HTML and highlighting, formatting, and mode-specific functionality all just work inside the string. In an Angular source file, all the template properties like "ng-if" autocomplete too, not sure if any code completion inside props works though (it doesn't with the AngularJS 1.x I just tested, but that's a different plugin that's probably less capable). Have to be careful about escaping the outermost quotes too if you use them in the template. So not exactly terrible, but still a little bit janky.
Re:Google: Angular and Wiz Are Merging by cout on Thursday March 21, 2024 @10:02AM (#39778619)
You could do that with angularjs 1.5 components too. But afaik it was/is not standard practice to embed html and css inside your js, because many (most?) editors treat html inside a string as a string instead of as html.