• About
  • Privacy Policy
  • Utilities
Darchuk.NET

JavaScript

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

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 Math.max

December 14, 2018 by Robert Leave a Comment

You’ve used it, you know it.  Given a series of numbers, it returns you the biggest one.  Simple.  Easy.  Definitely not blog post worthy. Syntax Math.max([value1[, value2[, …]]]) Usage Thank You That’s it for this week’s blog post, have a good day everyone…! via GIPHY Spooky Stuff Oh… You’re still here?  Huh?  What happens if … [Read more…]

Posted in: JavaScript Tagged: JavaScript, Math

Angular Transition Animations

October 26, 2018 by Robert Leave a Comment

For some reason I’ve procrastinated looking in to transition animations in Angular.  via GIPHY Transitions are visually pleasing, and it can give your application a nice feel that makes your users think “Wow, this is a nice site.” Subtle animations are the best – the ones you don’t really notice unless you’re looking for them.  … [Read more…]

Posted in: Angular, JavaScript, Typescript, Web Development Tagged: Angular, Animations, CSS, HTML, JavaScript, Typescript

Angular Typescript Filtering–rxjs debounceTime

October 19, 2018 by Robert Leave a Comment

Recently I had created a couple of components to make filtering and sorting a list of objects easier.  Essentially I wanted a table where the headers are clickable for sorting and also have a textbox below them for filtering. Now, this isn’t super great, because I’m downloading all of the data to the client side … [Read more…]

Posted in: Angular, JavaScript, Typescript, Web Development Tagged: Angular, debounce, FIltering, JavaScript, rxjs, Typescript

Jasmine–Setting the clock and deferring assertions

September 21, 2018 by Robert Leave a Comment

Sometimes when you’re writing Javascript unit tests you have to give Javascript a chance to catch up before checking your assertions.  Javascript uses a single event loop, so it isn’t multi-threaded in the same way as other languages.  You can still get a “multi-threaded feel” by using callbacks (promises, observables, etc), but at the end … [Read more…]

Posted in: Asynchronous, Jasmine, JavaScript, Typescript, Unit Testing, Web Development Tagged: Asynchronous, Jasmine, JavaScript, Testing, Typescript, unit testing

Jasmine & TypeScript–Calling and spying on private members

September 7, 2018 by Robert Leave a Comment

There’s some debate as to whether or not you should test private members in a class.  Generally, I fall in to the “if it makes sense to test it, test it” camp.  If there’s a private method that is only accessible by a hard-to-mock series of callbacks or events, I would much rather write a … [Read more…]

Posted in: Angular, Jasmine, JavaScript, Typescript, Unit Testing, Web Development Tagged: JavaScript, Private, Public, Testing, Typescript, unit testing
1 2 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