• About
  • Privacy Policy
  • Utilities
Darchuk.NET

Angular

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

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

[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

RxJS 6 testing error paths

December 7, 2018 by Robert Leave a Comment

In a previous post I talked about how to use Observable.throw to simulate an Observable error in a unit test.  However, in RxJS 6, the syntax changed a bit.  I also talked about this a bit in this post about using of to create Observables on the fly for testing in RxJS 6, but I … [Read more…]

Posted in: Angular, JavaScript, Typescript, Unit Testing, Web Development Tagged: Observable, rxjs, RxJS6, Testing, throwError, UnitTesting

Angular HttpClient error handling

November 30, 2018 by Robert Leave a Comment

HttpClient is the preferred way to make http calls from an Angular app.  It is simple and straightforward to use, returning an Observable<T>.  All you have to do is subscribe and the callback will be invoked when the data comes back from the server. via GIPHY But what about error handling? In a perfect world, … [Read more…]

Posted in: Angular, Web API, Web Development Tagged: Angular, Error, ErrorHandling, HttpClient, HttpErrorResponse
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