HostBinding and HostListener: what do they do and what are they for?

HostBinding and HostListener: what do they do and what are they for?

These are the most common terms used while creating custom directives in Angular.

These are the most common terms used while creating custom directives in Angular.

Before we start our discussions about the topic,

Are you preparing for interviews? Here are frequently asked interview questions in Angular. It covers the Latest interview questions for Angular and Frontend development. Let’s check how many of these questions you can answer?

If you are looking for the checklist to optimize the angular application performance check these articles.

Let's continue our discussion

import {Component,HostListener,Directive,HostBinding,Input} from '@angular/core';
@Directive({selector: '[customdirective]'})
export class CustomDirective {
  @HostBinding('attr.access') access = 'masteraccess'; 
  @HostListener('click') onClick() {
    this.access= this.access === 'masteraccess' ? 'normalaccess' :   'masteraccess';
  }
}

typescript angular javascript angular-4

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

Announcing TypeScript 4.0 | What’s New in TypeScript 4.0

We are thrilled to announce the availability of TypeScript 4.0! Let’s dive into what’s new in TypeScript 4.0: Variadic Tuple Types; Labeled Tuple Elements; Class Property Inference from Constructors; Short-Circuiting Assignment Operators; Editor Improvements

Install Angular - Angular Environment Setup Process

Install Angular in easy step by step process. Firstly Install Node.js & npm, then Install Angular CLI, Create workspace and Deploy your App.

JavaScript Vs TypeScript

Get to know here difference between JavaScript & TypeScript, In this blog explained with pros and cons of TypeScript & JavaScript.

Basics of Angular: Part-1

What is Angular? What it does? How we implement it in a project? So, here are some basics of angular to let you learn more about angular. Angular is a Typesc

Short TypeScript Import Paths in Angular 9

How to setup import path aliases in Angular9 and why you should do it as the first thing for any Angular project. Short TypeScript Import Paths in Angular9