Tag: Angular
-
Step-by-Step Understanding the Async Pipe
The async pipe can make a huge difference in your change detection strategy for your Angular app. If it’s been confusing to you so far, come work through this step-by-step explanation. We’ll understand it together! In Angular, the async pipe is a pipe that essentially does these three tasks: Also, as a best practice, it…
-
Making Angular Service – Always Singleton
By default, Angular Services are Singleton. When you create a service using the CLI command, ng g s App Angular creates a service named AppService. The above service is Singleton Tree-shakeable Available throughout the application Singleton means Angular creates only one object of the AppService, regardless of how many places you use it. However, if…
-
Angular 14 – Introducing Standalone Components
Angular 14 introduces Standalone Components. A component that is not part of ngModule.
-
The simplest way to disable console.log for Production build in Angular?
I work with different developers, and most of them rely on console.log () or other console methods for development. They use the console to print various values to debug while doing the development. I call this approach console-driven development. Cool name, right? These console functions become overwhelming in production as users can see many things…
-
Video – Angular Interview : is Angular Service Singleton ?
One of the most popular Angular interview questions is, whether a service is singleton? By default, when you create a service using the below CLI command, ng g s app AppService is singleton, however it can be re-provided to create more objects of it. Say, you again re provide AppService in one of the components,…
-
Change Detection in Angular
Change Detection is the backbone of the Angular framework, and each component has its own change detector. This article explains change detection strategies and optimizations to help you write highly performant Angular applications. Angular can detect when data changes in the component, and can re-render the view to display the updated data. Angular makes sure…
-
How to use conditions in Angular Template using
There are various ways you can apply conditions on Angular Template. Usually, you apply conditions to show a particular value or render a specific element based on a condition. In this post, let us see, the simplest way of achieving the conditions in Angular Template using the <ng-container> and <ng-template>. To start with consider data,…
-
Why use exportAs Property in Angular
Have you used exportAs property of a directive? It could be instrumental in working with public methods of a directive. Let us say; you have created a custom directive to change the background colour of the host element on the mouse hover as below, The above custom directive changes the background colour of the host…
-
Video – Simplifying Dependency Injection and Services in Angular, ng-India Webinar recording
In this webinar, you learn about Tree shakabale service Singleton service Various provideIn options such as forRoot, any Providers useClass, useFactory, useValue, useExisting Global Error Handling Services in lazy loaded modules For more such videos subscribe to the channel here : https://www.youtube.com/c/geek97