• About
  • Privacy Policy
  • Utilities
Darchuk.NET

Typescript

YADNC3JSG–Yet Another .NET Core 3.0 JSON Serializer Gotcha

October 25, 2019 by Robert Leave a Comment

Previously I wrote about several “gotchas” in the new JSON serializer that is built in to .NET Core 3.0.  Another one has cropped up, but it is different enough that I thought it warranted its own post. Type Promiscuity via GIPHY Back in 2010 or something like that, Ted Neward gave a talk about JavaScript … [Read more…]

Posted in: .NET Core, Angular, ASP.NET, C#, JavaScript, Typescript, Web Development Tagged: .NET Core 3, ASP.NET Core, C#, DotNetCore, JavaScript, Typescript

TypeScript – Enumerating object properties with Object.keys

June 21, 2019 by Robert Leave a Comment

One of the benefits of JavaScript (and therefore TypeScript) is being able to do whatever you want with objects.  This can be dangerous, of course, because of type promiscuity – which is one thing that TypeScript addresses. via GIPHY Object.keys Sometimes it is still useful to just loop through each property on an object in … [Read more…]

Posted in: JavaScript, Reflection, Typescript, Web Development Tagged: Gotcha, JavaScript, Reflection, Typescript

Angular date picker with NgbDatePicker

June 14, 2019 by Robert Leave a Comment

DatePickers are pretty much a dime a dozen these days, but if you are already using a framework that already has a DatePicker, it makes sense to use that. via GIPHY ng-bootstrap ng-bootstrap is a package of Angular components that are built using Bootstrap 4.  So, if you’re already using Bootstrap and Angular, it could … [Read more…]

Posted in: Angular, CSS, HTML, JavaScript, Typescript Tagged: Angular, Bootstrap, HTML, JavaScript, Typescript

Uploading a file from a website

March 22, 2019 by Robert 1 Comment

Uploading a file from a website is pretty simple, but I always have to look it up.  There’s all sorts of different technologies and frameworks that work with the web, so I just thought I would write down how I got it to work so that next time I can just come back here and … [Read more…]

Posted in: .NET Core, Angular, ASP.NET, C#, JavaScript, Typescript, Web API, Web Development Tagged: .NET Core, Angular, ASP.NET, File, MemoryStream, Typescript, Upload, Web API

NaN !== NaN

March 15, 2019 by Robert Leave a Comment

So there I was, minding my own business, again writing JavaScript tests… when suddenly I wanted to write a test to see what happens if NaN was supplied as a parameter. via GIPHY NaN Stands for “Not A Number”.  You can get a NaN in a few different ways: But when checking for NaN, there’s … [Read more…]

Posted in: JavaScript, Typescript Tagged: Falsy, JavaScript, NaN, Truthy, Typescript

[object ErrorEvent] thrown … again

March 8, 2019 by Robert Leave a Comment

So there I am, happily writing unit tests, and suddenly this appears I keep seeing this error while trying to write Angular tests.  I… *think* this happens when something goes wrong during the constructor of a component.  I’ve written before about how it could be due to an @Input property not being initialized properly. But, … [Read more…]

Posted in: Angular, Jasmine, JavaScript, Typescript, Unit Testing Tagged: Angular, Jasmine, JavaScript, Testing, Typescript, UnitTesting

Javascript–Caching a web request with Promises

March 1, 2019 by Robert Leave a Comment

Suppose you have some data that comes from a web server somewhere.  But, it doesn’t change – so we really only need to fetch it once, and then store the result for easy access (maybe its an Enum that you map to a list of key/value pairs).  We can do this easily enough in a … [Read more…]

Posted in: Angular, JavaScript, Typescript, Web Development Tagged: Angular, Typescript, Web Development, WebAPI

Unit Testing NgbModal Modal Service

January 18, 2019 by Robert Leave a Comment

In the last blog post I showed how you could extend NgbModal to make a Modal Service, letting you re-use modal dialogs easily from within your Angular components. Even though its not always that much fun, I like to try and keep testability in mind when writing code… and, I’ll admit it, sometimes I gloss … [Read more…]

Posted in: Angular, Jasmine, JavaScript, Typescript, Unit Testing, Web Development Tagged: Angular, Dialog, Modal, NgbModal, Testing, Unit Test

Angular–Making a Modal Service by Extending NgbModal

January 11, 2019 by Robert 1 Comment

I like the idea of modal dialogs for certain things, especially showing error messages or confirming an action.  Creating (and styling) modal dialogs can vary so much that Angular doesn’t include them out of the box.  There’s a bunch of libraries out there that give you this functionality, including ones that are tied to a … [Read more…]

Posted in: Angular, Asynchronous, HTML, Typescript, Web Development Tagged: Angular, Blocking, Bootstrap, Dialog, Modal, NgBootstrap

Angular–Displaying objects as JSON

December 28, 2018 by Robert Leave a Comment

Sometimes, especially when you’re debugging or planning out your component layouts, it can be useful to just write out the entire object as JSON so you can see just what you’re dealing with.  You can do this in Chrome’s console usually with good results, but sometimes it would be easier to see it in the … [Read more…]

Posted in: Angular, Debugging, HTML, JavaScript, Typescript, Web Development Tagged: Angular, Debugging, Json, pipe
1 2 … 4 Next »

Recent Posts

  • Allowing trailing JSON commas in ASP.NET Core 3
  • YADNC3JSG–Yet Another .NET Core 3.0 JSON Serializer Gotcha
  • Logging in a .NET Core 3 SignalR client
  • .NET Core 3 unit testing project sdk
  • .NET Core 3.0 Upgrade–New JSON Serializer Gotchas

Recent Comments

  1. Robert on C# Setting Socket Keep-Alive
  2. Oliver Schramm on C# Setting Socket Keep-Alive
  3. John Anderson on Waiting for a keypress asynchronously in a C# console app
  4. Ronald Garlit on .NET Core 3 unit testing project sdk
  5. Ronald Garlit on .NET Core 3 unit testing project sdk

Copyright © 2025 Darchuk.NET.

Omega WordPress Theme by ThemeHall