Blog

Page 101 of my articles, tutorials, and thoughts

Latest Articles

Cover Image for ngOnInit not being called when Injectable class is Instantiated
javascript

ngOnInit not being called when Injectable class is Instantiated

Published on September 2, 2023

# Why ngOnInit is not called when an Injectable class is Instantiated? 🤔 Have you ever encountered a situation where the `ngOnInit()` function was not called even though your class implements the `OnInit` interface? It can be quite frustrating, but don't

Cover Image for Delegation: EventEmitter or Observable in Angular

Delegation: EventEmitter or Observable in Angular

Published on September 2, 2023

# Delegation: EventEmitter or Observable in Angular? 🤔 Are you trying to implement a delegation pattern in your Angular project? Do you want to emit an event from one component and handle it in another component? 🚀🔗 Well, you've come to the right plac

Cover Image for tslint / codelyzer / ng lint error: "for (... in ...) statements must be filtered with an if statement"

tslint / codelyzer / ng lint error: "for (... in ...) statements must be filtered with an if statement"

Published on September 2, 2023

📝 **Blog Post: Quick Fix for "for (... in ...) statements must be filtered with an if statement" Error in TSLint** Are you seeing the dreaded TSLint error message: "for (... in ...) statements must be filtered with an if statement"? Don't worry, you're n

Cover Image for How to redirect to an external URL in Angular2?
redirect

How to redirect to an external URL in Angular2?

Published on September 2, 2023

# How to Redirect to an External URL in Angular 2? 🌐 Are you trying to redirect your users to an external URL in your Angular 2 application? Maybe you need to send them to an OAuth2 server for authentication? Well, look no further! In this blog post, we

Cover Image for TypeScript-"s Angular Framework Error - "There is no directive with exportAs set to ngForm"

TypeScript-"s Angular Framework Error - "There is no directive with exportAs set to ngForm"

Published on September 2, 2023

# How to Fix TypeScript's Angular Framework Error - "There is no directive with exportAs set to ngForm" Are you facing the frustrating error message "There is no directive with exportAs set to ngForm" while using TypeScript's Angular2-forms framework? Don

Cover Image for Importing lodash into angular2 + typescript application
javascript

Importing lodash into angular2 + typescript application

Published on September 2, 2023

# Importing lodash into Angular2 + TypeScript Application: A Comprehensive Guide 💪 Are you facing difficulties while trying to import lodash modules into your Angular2 + TypeScript application? Don't worry, you're not alone! Many developers struggle with

Cover Image for flatMap, flat, flatten doesn"t exist on type any[]

flatMap, flat, flatten doesn"t exist on type any[]

Published on September 2, 2023

🔍 Understanding the Problem: flatMap, flat, and flatten are missing on type any[] So, you're using Chrome 70 and everything runs smoothly because Chrome adds these cool methods like `.flatMap`, `.flatten`, and `.flat` to arrays. But here's the catch: Typ

Cover Image for Define global constants

Define global constants

Published on September 2, 2023

# What Are Global Constants in Angular? If you've worked with Angular before, you've probably come across the need to define constants to store values that remain the same throughout your application. In Angular 1.x, you could easily define global constan

Cover Image for Can"t bind to "routerLink" since it isn"t a known property

Can"t bind to "routerLink" since it isn"t a known property

Published on September 2, 2023

# Can't bind to 'routerLink' since it isn't a known property: Easy Solutions and Common Issues 💥🔗 So, you're working with Angular 2 and experiencing an error when trying to bind the `routerLink` property in your header component? No worries, we've got y

Cover Image for How to write unit testing for Angular / TypeScript for private methods with Jasmine
unit-testing

How to write unit testing for Angular / TypeScript for private methods with Jasmine

Published on September 2, 2023

# How to Write Unit Testing for Angular / TypeScript for Private Methods with Jasmine 💻 Testing private methods in Angular / TypeScript can be tricky since they are not directly accessible outside of the class. However, there are a couple of solutions th