Skip to main content

Posts

Showing posts with the label Angular 7

What Is trackBy in Angular? | When to Use in ngFor and ng-repeat?

The “ track by ” expression to specify unique keys.   The “ track by ” takes a function that has two arguments: index and item. If “track by” is given, Angular tracks changes by the return value of the function. Understanding About *ngFor Mechanisms:- By default, when you use * ngFor without “track by”, *ngFor tracks array of objects changing through object identity. If you are going to modify (add, update, remove) any element of * ngFor , then update the tracking algorithm by providing your object id to the “track by”function.” Why use “track by”with ngFor directive? The “ngFor” directive may perform poorly with large lists. A small change to the list like, adding a new item or removing an existing item may trigger several DOM manipulations. Syntax of ngFor Angular: < tr   *ngFor = "let user of users; let i = index" >      < td > {{user.name}} </ td >    ...

Angular 9 Coding Style Guideline - 8, 7, 6, 5, 4, 2

The Angular coding guideline will helps us to understand to write the great code. It must be follows each and every Angular developers. Explore -   What Are Differences in Angular 9, 8, 7, 6, 5, 4, 2? Single Responsibility - Apply the single responsibility principle (SRP) to all components, services, and other symbols. This helps make the app cleaner, easier to read and maintain, and more testable. Rule of One - Do define one thing, such as a service or component, per file and consider limiting files to 400 lines of code. Small functions - Do define small functions and consider limiting to no more than 75 lines. General Naming Guidelines - Do use consistent names for all symbols and the recommended pattern is - feature.type.ts. Separate file names with dots and dashes - 1.       Do use dashes to separate words in the descriptive name. 2.       Do use dots to separate the descriptive name from the ...

Angular 9 Interview Questions and Answers - A Complete Guide Book

What Is Angular? What's New in Angular 9? What Are Differences in Angular 9 and Angular 8? List of All Angular FAQs What Are Components in Angular? What Is Angular Modules? What Are Angular Directives? What Is Dependency Injection (DI)? What Is Pipe? Types of Angular Pipe? What Is Routing and Navigation? What Is Angular Services? What's Angular Elements? What Is Service Workers? Types? What Is HttpClient? Angular Security? What Is Angular Testing? Angular Cookies? What Is Form, Template, and Validations? What Is Angular? Angular is the most popular web development framework for developing mobile apps as well as desktop applications. The angular framework is also utilized in the cross-platform mobile development called IONIC and so it is not limited to web apps only. Angular is an open source framework written and mai...