Open in app

Sign In

Write

Sign In

Fuzzy Code
Fuzzy Code

22 Followers

Home

About

Sameer Gurung

Sameer Gurung

·Feb 1

How to configure Angular to build to different environments

Angular is a popular JavaScript framework for building web applications, and it provides a way to configure the build for different environments, such as development, staging, and production. In this blog post, we’ll cover how to configure Angular for building to different environments. Step 1: Create environment files The first step is to create environment…

Angular

2 min read

How to configure Angular to build to different environments
How to configure Angular to build to different environments
Angular

2 min read


Sameer Gurung

Sameer Gurung

·Jan 28

How to pass data from child component to a parent component in Angular

Passing data from a child component to a parent component in Angular can be done using several methods. Here are two common ways to accomplish this: Using the EventEmitter class Using a shared service 1. Using the EventEmitter class One way to pass data from a child component to a parent component is by using…

Angualr

2 min read

How to pass data from child component to a parent component in Angular
How to pass data from child component to a parent component in Angular
Angualr

2 min read


Sameer Gurung

Sameer Gurung

·Jan 28

How to pass data between a child component and parent component using shared service in Angular

Here’s an example of how to pass a variable from a child component to a parent component using a shared service in Angular: 1. Create a shared service import { Injectable } from '@angular/core'; import { Subject } from 'rxjs'; @Injectable({ providedIn: 'root' }) export class DataService { private dataSource = new…

Angular

2 min read

How to pass data between a child component and parent component using shared service in Angular
How to pass data between a child component and parent component using shared service in Angular
Angular

2 min read


Sameer Gurung

Sameer Gurung

·Jan 27

How to pass data from parent component to child component in Angular

There are several ways to pass data/variables from a parent component to a child component in Angular. Two of the most common method are: Using @Input decorator Using shared service 1. Using @Input decorator One way is to use the @Input() decorator to declare a variable in the child component that will receive the…

Angular

2 min read

How to pass data from parent component to child component in Angular
How to pass data from parent component to child component in Angular
Angular

2 min read


Sameer Gurung

Sameer Gurung

·Jan 26

How to store unique values in an array in JavaScript like a boss

We can use Set to store unique values in an array like a boss 💪. The Set object lets you store unique values of any type, whether primitive values or object references. const colors = ['blue', 'red', 'green', 'black', 'green']; console.log(colors); // ['blue', 'red', 'green', 'black', 'green'] const unique = Array.from(new Set(colors)); console.log(unique); // ['blue', 'red', 'green', 'black'] Set objects are collections of values. A value in the Set may only occur once; it is unique in the Set's collection. You can iterate through the elements of a set in insertion order. The insertion order corresponds to the order in which each element was inserted into the set by the add() method successfully (that is, there wasn't an identical element already in the set when add() was called).

JavaScript

1 min read

JavaScript

1 min read


Sameer Gurung

Sameer Gurung

·Jan 21

Asynchronous validation of a form in Angular

Here is an example of how you could add asynchronous validation to a form in Angular: First, you’ll need to import the FormControl and FormGroup classes from the @angular/forms module, as well as any other modules that you'll need for your validation logic. import { FormControl, FormGroup } from '@angular/forms'; …

Angular

2 min read

Asynchronous validation of a form in Angular
Asynchronous validation of a form in Angular
Angular

2 min read


Sameer Gurung

Sameer Gurung

·Jan 21

What is event bubbling and capturing in JavaScript?

Event bubbling Event bubbling is a mechanism in JavaScript where an event propagates from the innermost element (i.e., the element that the event originated from) outwards to the outer elements. This means that if an event is triggered on a child element, it will also trigger on its parent elements, all the…

JavaScript

3 min read

What is event bubbling and capturing in JavaScript?
What is event bubbling and capturing in JavaScript?
JavaScript

3 min read


Sameer Gurung

Sameer Gurung

·Jan 21

Simple code for rating of users in JavaScript

Here is an example of a simple code rating system implemented in JavaScript: // An array to store the ratings for each user let ratings = []; // A function to add a new rating for a user function addRating(user, rating) { ratings.push({ user: user, rating: rating }); } // A function…

Rating

1 min read

Rating

1 min read


Sameer Gurung

Sameer Gurung

·Jan 12

What is Hoisting in JavaScript?

Hoisting is a behavior in JavaScript where variable and function declarations are moved to the top of their scope, regardless of where they appear in the code. …

Hoisting

2 min read

Hoisting

2 min read


Sameer Gurung

Sameer Gurung

·Jan 12

What is Closure in JavaScript?

A closure in JavaScript is a function that has access to the variables in the scope where it was defined, even if that function is executed outside of that scope. This is possible because the function “closes over” the variables, meaning it retains a reference to them. To create a…

Closure

2 min read

Closure

2 min read

Fuzzy Code

Programming tutorials, tech guides and more… YT: https://www.youtube.com/channel/UCtFQYfS3IGnr6LtYqrt_n4Q

Editors

Sameer Gurung

Sameer Gurung

A Software Engineer, who also turns to be a JavaScript enthusiast. Currently working with NodeJs, Angular, Ionic and AWS. Catch me: https://smrgrg.com

Help

Status

Writers

Blog

Careers

Privacy

Terms

About

Text to speech

Teams