Open in app

Sign in

Write

Sign in

Aditya Narayan Gantayat
Aditya Narayan Gantayat

9 Followers

Home

Lists

About

Published in

CodeX

·Nov 13

Are you using useState the right way?

useState, the React hook is one of the routine stuffs for a React developer. We, as React devs, know that it is used to trigger a re-render whenever the state changes. It’s simple, right? I mean, what could be complicated about that? …

React

4 min read

Are you using useState the right way?
Are you using useState the right way?
React

4 min read


Published in

CodeX

·May 23

Functional Resolvers in Angular

Resolvers in Angular are data providers that are used to pre-fetch data when the user is navigating through the application before Angular has rendered the desired page; i.e. it blocks the navigation until it’s resolved. The resolved data is accessible in the component through the ActivatedRoute class. Previously we used…

Angular

2 min read

Functional Resolvers in Angular
Functional Resolvers in Angular
Angular

2 min read


Published in

CodeX

·Oct 10, 2022

How does Dependency Injection work in Angular?

We all have used Dependency Injection irrespective of the tech stack, at some point in our coding journey. But what’s the reason for using it? Imagine instantiating a class each time we need to access it! Awful, yes! We use DI to avoid hard dependencies between classes. Dependency Injection ensures…

Angular

3 min read

How does Dependency Injection work in Angular?
How does Dependency Injection work in Angular?
Angular

3 min read


Published in

CodeX

·May 19, 2022

Promises and more…

People often confuse Promises to be asynchronous. But are they really asynchronous? Promises are arguably the most important concept of asynchronous programming in JavaScript, however, the execution of the callbacks passed into the Promise constructor is synchronous. Let’s understand the same with an example: Like you can see, when the…

JavaScript

3 min read

Promises and more…
Promises and more…
JavaScript

3 min read


Feb 15, 2022

Unit testing for valueChanges of formControl in Angular

There can be n number of ways to trigger the valueChanges(). this.formName.get(‘form_control’).valueChanges .subscribe((changedValue: boolean) => { console.log(changedValue); this.formName.get(‘another_form_control’).setValue(‘’) }); Suppose this is the code that you want to cover in your test cases. Tried the setValue() and patchValue(); but for some reason, the subscription body is not covered in the…

Angular

1 min read

Angular

1 min read


Aug 24, 2021

Angular Material MatSort in multiple tables. How to make it work properly?

I was stuck with this issue for hours. The sorting didn’t work properly(worked after clicking 3–4 times for whatever reason), and at times sorting one table would affect the other as well(checked using console.log) If your multiple tables look like this: <table mat-table [dataSource]=”DataSource1” matSort (matSortChange)=”sortData($event)”> <table mat-table [dataSource]=”DataSource2” matSort (matSortChange)=”sortData($event)”>

Angular

1 min read

Angular Material MatSort in multiple tables. How to make it work properly?
Angular Material MatSort in multiple tables. How to make it work properly?
Angular

1 min read

Aditya Narayan Gantayat

Aditya Narayan Gantayat

9 Followers
Following
  • John Au-Yeung

    John Au-Yeung

  • Fabricio Teixeira

    Fabricio Teixeira

  • Hussein Nasser

    Hussein Nasser

  • Lakin Mohapatra

    Lakin Mohapatra

  • Netanel Basal

    Netanel Basal

See all (18)

Help

Status

About

Careers

Blog

Privacy

Terms

Text to speech

Teams