4 ms·
This part is pretty scary... (sorry for the bad formatting) ... but god forbid you mix up the syntax - the following will simply silently fail with no warnings
by tsneed290 10y ago
This part is pretty scary... (sorry for the bad formatting)
... but god forbid you mix up the syntax - the following will simply silently fail with no warnings:
<template *ngIf="condition">...</template>
The reason is because the you see is a syntactic sugar that essentially wraps the element in a <template>. The problem is when used on <template> tag this gets translated into:*
<template [ngIf]="condition"><template>...</template></template>
which doesn’t render anything at all.
- coltonv 10y ago"Silently fail with no warnings" is like the angular motto... At least in Angular 1 if something failed usually angular would just show an empty string on the screen. Debugging is just a cold dark hell where very very few resources can help you find what went wrong, you basically just need to litter everything with console logs (Except the template html syntax, which you can't just write JS log statements in since... it's not javascript, its it's own language. I've become much more productive and comfortable in all the JS vdom frameworks which have no template language, just javascript.
- hinkley 10y agoThis, I think, is a common problem with library writing in general, and doubly so for Javascript. Ember tries, but it's still remarkably easy to get a cryptic error from it. The ergonomics for using libraries needs to improve a great deal. I have my fingers crossed that this will be something most people have on their radar soon, but I'm not holding my breath.
- merb 10y ago"Silently fail with no warnings" is like the angular motto... At least in Angular 1 if something failed usually angular would just show an empty string on the screen. not true, while still developing the angularjs 1 app in my company it actually prints either a useful error or a cryptic long stacktraces error. But basically it still is a awful framework, still working on the replacement.
- FrancoDiaz 10y agoSilent failures was why I left Aurelia too. It's probably the best of breed of those types of MVM frameworks, but it suffers the same problem. Just let me use JavaScript.
- resonantjacket5 10y agoTheyve made it better recently where if it crashes it shows the error