Debugging NestJS app in NRWL NX workspace

Debugging can save you ton of time. But sometimes to set up debugging configuration correctly can be a nightmare. There are several common gotchas which may trick you. Code is in Typescript, but NodeJS in debugger does not understand its syntax. You use combination of .ts and .js files with import or export statement Debugger …

Rainbow text color in CSS

No images, this is pure CSS. This is really funny. You can have rainbow text on gradient background purely in CSS. No images needed. And yes, you can have radial background too. On a long text in looks funny and cool. Look, how awesome (and weird) it is. Mystical colors. And here is the trick …

Working with Angular i18n inside NRWL NX workspace

Angular v10 has great support for localization using the i18n attributes. I will not describe it, because that is already described in detail on official Angual site. What I found missing was how to integrate it with NRWL NX approach. Problems encountered For starters, the workspace.json has different structure than angular.json, so some parts are …

Angular animation trap

Animations in Angular.io are a nice feature. But their error messages can be quite misleading. When you forgot to define the animations array in the @Component annotation, then Angular will report following error message: “Found the synthetic property @detailExpand. Please include either “BrowserAnimationsModule” or “NoopAnimationsModule” in your application That is clearly misleading, because the error …

Input fields with dynamic width in Angular

Have you ever typed text into small input field and did not see the whole text at once? It can be really frustrating. Textareas can be natively resized in most browsers today, but plain old input fields can not. To address this I have written small Angular directive. See it in action in the video …

Useful Typescript / Angular code snippets

Below are some useful code snippets I wrote. I use them as a reference, because they when I occasionally need them, I never know them by heart. Hope this will help you too. If so, let me know in the comments. Convert enum to array Set all controls in Angular dynamic form to readonly Get …

Delayed hover event in Angular

Use case: Display tooltip only after user has been hovering for some time already. If he leaves sooner, then do not display anything. Technologies Angular, RxJs, Ngx UntilDestroy Authors David Votrubec and Luďek Cakl Implementation The logic behind is that we combine two streams. One stream is for the mouseenter event, and the other is …

Ctrl-click directive in Angular

Angular has lot of built-in directives for listening for events like click, dblclick, mousein, mouseout etc. But sometimes you need something more sophisticated, like detect ctrl-click. I did not find any directive which would suit my needs, so I had to write my own. Be aware that normal browser behaviour for ctrl-click is to open …

Provide username and password for git clone

There are situations when you need to clone some privately hosted git repository, which is accessible only via http. (Yes, I know it is not secure, but that was not my choice). Ssh access is not provided, and neither is https. The only access is via http accessible on VPN. The connection is protected with …

Awaitable http(s) request in Nodejs and Pulumi

Pulumi is a great tool for quick and easy deployment to cloud. It provides nice abstraction above several cloud providers, such as AWS, Kubernetes or Azure. But it also has some drawbacks. The biggest plus is that you can define your lambdas, tasks etc in single index.js file and import dependencies from other npm packages. …