Disable a Button in Angular | 2 Easy Examples

Disable a Button in Angular | 2 Easy Examples

Set the disable property to true to disable a button in Angular <button [disable]=”true” …></button> Set the disable property to false to enable a button in Angular <button [disable]=”false” …></button> In this article, we’ll learn how to disable a button in Angular. We’ll create a simple To-Do List App with one component. The main requirements…

ngOnChanges Example Step-by-Step

ngOnChanges Example Step-by-Step

ngOnChanges is a method in a component’s class (or directive) executed whenever a change occurs in an @Input property of the class. In this ngOnChanges example, we’ll learn how to use the ngOnchanges lifecycle hook in Angular. We’ll create a simple chores list app using only two components – a parent (App Component) and a…

How to Pass Data from Parent to Child Component in Angular

How to Pass Data from Parent to Child Component in Angular

In the Parent Component‘s Class – Add a field (for example, parentProperty) that will store the data you want to pass to the child. In the Child Component’s Class – Add a property with the @Input() decorator (childProperty). In the Parent Component’s Template – Add the child component’s selector, which will “call” the component into…

Angular Initial File Structure and Bootstrapping

Angular Initial File Structure and Bootstrapping

The src folder contains all files related to our Angular app. The .gitignore file indicates which files should be ignored by git. The .browserslistrc contains configurations for target browsers. Angular.json contains configurations for the build process. Karma.conf.js contains configurations for unit testing. Package.json defines the required npm dependencies for the app. Tsconfig.app.json contains compiler options…