Your source of geek knowledge

Y

Latest stories

Our journey to F#: JSON serialization with a mix of C# and F#

O

There are many libraries for JSON serialization in the .Net realm. The best known are probably Newtonsoft’s Json.NET and System.Text.Json. Both can’t handle F# discriminated unions very well. There are also a couple of F# JSON libraries available like Thoth.Json or FSharp.Json. They are all great libraries, and choosing one is about making trade-offs. However, our case is a bit complicated because we have a mix of C# and F# code. This results in object/value graphs that consist of a...

Angular Component – part 3: Validation

A

This is part 3 of my series about Angular components.If you haven’t already, check out part 1 (one-way and two-way binding) and part 2 (ngModel) to see how and why to write an Angular component following the ngModel pattern.

Our goal for this part of the series is to learn how to validate your angular component’s user inputs to disable the submit of a form surrounding our form-control.

Type-safety across .Net and TypeScript – TypeScript-friendly JSON serialization of F# types

T

This is part 6 of how we generate types from our .Net backend to be used in our TypeScript client. Why do we even bother?Generating TypeScript constants from .Net constantsFinding the types used in communication between the .Net backend and the TypeScript clientGenerating TypeScript classes from .Net typesGenerating Angular Services from .Net WebApi ControllersTypeScript-friendly JSON serialization of F# typesTesting JSON serialization and deserializationPutting all the parts together None of...

Angular Component – Part 2: ngModel

A

In my last article, I’ve explained how to use @Input() and @Output() and how to combine them to offer two-way binding for your component. This time I want to take this component to behave like a proper control within a <form>-element that is using ngForm. What’s ngModel, and why should I use it? In a typical Angular application, we often encounter scenarios where we have to handle forms with various input controls and a button to send data or perform some sort of action. The...

Angular Component – Part 1: one-way binding vs. two-way binding

A

In this short blog series, I want to show how to create an Angular component that can be used for user inputs. I know this is a topic for which many articles have been published. But while there are great tutorials that explain how it’s done, many of them lack the answer to the question of why. This is the reason I’m describing in this series how and why we are writing our components the way we do here at TimeRocket. This will be a 5-part series on the topic, so bear with me if the...

Type-safety across .Net and TypeScript – Angular Services from WebApi Controllers

T

This is part 5 of how we generate types from our .Net backend to be used in our TypeScript client. Why do we even bother?Generating TypeScript constants from .Net constantsFinding the types used in communication between the .Net backend and the TypeScript clientGenerating TypeScript classes from .Net typesGenerating Angular Services from .Net WebApi ControllersTypeScript-friendly JSON serialization of F# typesTesting JSON serialization and deserializationPutting all the parts together...

Type-safety across .Net and TypeScript – Generating TypeScript classes

T

This is part 4 of how we generate types from our .Net backend to be used in our TypeScript client. Why do we even bother?Generating TypeScript constants from .Net constantsFinding the types used in communication between the .Net backend and the TypeScript clientGenerating TypeScript classes from .Net typesGenerating Angular Services from .Net WebApi ControllersTypeScript-friendly JSON serialization of F# typesTesting JSON serialization and deserializationPutting all the parts together Be...

Type-safety across .Net and TypeScript – Finding the types

T

This is part 3 of how we generate types from our .Net backend to be used in our TypeScript client. Why do we even bother?Generating TypeScript constants from .Net constantsFinding the types used in communication between the .Net backend and the TypeScript clientGenerating TypeScript classes from .Net typesGenerating Angular Services from .Net WebApi ControllersTypeScript-friendly JSON serialization of F# typesTesting JSON serialization and deserializationPutting all the parts together Be...

Type-safety across .Net and TypeScript – Constants

T

This is part 2 of the series about how we generate code from .Net for TypeScript:

Why do we even bother?Generating TypeScript constants from .Net constantsFinding the types used in communication between the .Net backend and the TypeScript clientGenerating TypeScript classes from .Net typesGenerating Angular Services from .Net WebApi ControllersTypeScript-friendly JSON serialization of F# typesTesting JSON serialization and deserializationPutting all the parts together

Type-safety across .Net and TypeScript – Why?

T

A little while ago, I asked on Twitter whether someone would be interested in reading about how we generate types from our .Net backend to be used in our TypeScript client. So, here we are. I’ll cover the following topics: Why do we even bother?Generating TypeScript constants from .Net constantsFinding the types used in communication between the .Net backend and the TypeScript clientGenerating TypeScript classes from .Net typesGenerating Angular Services from .Net WebApi...

Recent Posts