• About
  • Privacy Policy
  • Utilities
Darchuk.NET

Angular

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

Styling ngb-pagination to be display: inline-block

October 12, 2018 by Robert Leave a Comment

Recently I wanted to have a ng-pagination control as well as a few “results per page” links to change the number of items displayed in a given page. However, ngb-pagination is always displayed as a block, so you have to fiddle around with it to get it to work.  First I tried to just put … [Read more…]

Posted in: Angular, CSS, HTML, Web Development Tagged: Angular, CSS, ngb-pagination, NgBootstrap

Angular Unit Testing–Cannot read property ‘ngInjectableDef’ of undefined

October 5, 2018 by Robert 12 Comments

Recently, I was writing some unit tests for Angular.    It was a pretty basic test, just checking to see if a method on an injected provider was called when a method in my component executed… but suddenly everything blew up with this weird error: TypeError: Cannot read property ‘ngInjectableDef’ of undefined Googling around didn’t really … [Read more…]

Posted in: Angular, Jasmine, JavaScript, Typescript, Unit Testing Tagged: Angular, Jasmine, Testing, Typescript, unit testing

Angular–Creating hooks to window events

September 28, 2018 by Robert Leave a Comment

Recently I had an Angular component that needed to be manually sized based on the window’s size.  Admittedly, this is pretty annoying, but the user experience was so much better than anything I could come up with using straight CSS.  It worked fine to get the dimensions of the window and calculate the width and … [Read more…]

Posted in: Angular, Asynchronous, JavaScript, Typescript, Web Development Tagged: Angular, Emit, Event, Hook, Observable, rxjs, Subject, Window

Jasmine–Testing code that contains setTimeout

September 14, 2018 by Robert Leave a Comment

Recently I wrote some code that contained a setTimeout.  The reason was so that the UI could catch up before the function actually fired – something that I’ve found the need to do with javascript from time to time. So, when it comes to testing the code… my test just skipped along until it literally … [Read more…]

Posted in: Angular, Asynchronous, Concurrency, Jasmine, JavaScript, Typescript, Unit Testing, Web Development Tagged: Angular, async, Jasmine, setTimeout, Testing, Typescript, unit testing

Testing Observables in Angular >= 6.0.0

August 17, 2018 by Robert Leave a Comment

In a previous post I talked about testing Observables in your Angular code.  This is pretty common, because HttpClient sends back an Observable<T> – so if you want to spyOn that function, you’ll need to figure out how to return an Observable. I’ve been bouncing around a couple of projects/repos recently, and it turns out … [Read more…]

Posted in: Angular, Asynchronous, Jasmine, Typescript, Unit Testing Tagged: Angular, Jasmine, Observable, rxjs, Testing, Typescript, unit testing

Unit Testing Angular–initializing an object in ngOnInit

July 27, 2018 by Robert Leave a Comment

Recently I had a problem where in an Angular unit test where I had an object that was being initialized in ngOnInit from a service.  As far as I could tell, everything should be working, but the test would fail because I was trying to set a property on the object before it had finished … [Read more…]

Posted in: Angular, Debugging, Jasmine, Typescript, Unit Testing, Web Development Tagged: Angular, Jasmine, Karma, ngOnInit, Testing, Typescript, unit testing

C# Mapping an Enum to a key value pair

May 18, 2018 by Robert 2 Comments

Enums are useful because they help you avoid magic numbers.  You can write your code in a way that is easy to read and understand from the human’s perspective, which, at the end of the day, is pretty important. Exposing enums on your Web API I want to share my enums with other things, notably … [Read more…]

Posted in: .NET Core, ASP.NET, C#, Typescript, Web API, Web Development Tagged: .NET, Angular, ASP.NET, C#, enum, Typescript, Web API

Angular 2+: Binding HTML Select ngModel to a number

April 20, 2018 by Robert Leave a Comment

I hate magic things.  In programming, I mean.  I try to avoid magic strings and magic numbers as much as possible because I can barely remember the thing I typed five seconds ago, let alone something that you have to maybe type five hours from now.  So, I tend to use a lot of enums … [Read more…]

Posted in: Angular, HTML, Typescript, Web Development Tagged: Angular, HTML, JavaScript, Option, Select, Typescript, Web Development
« Previous 1 2 3 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