Angular 16 adds a new future of making an @Input() decorated property REQUIRED, which means that to use that component, the value of the required property has to be passed. @Input({required:true}) title? :string; To Understand it, let us assume that you have a component named ProductComponent with @Input() decorated properties as shown below, const templateContinueContinue reading “Required @Input properties in Angular”
Category Archives: Angular
Video – How to reset a Form in Angular? | How to set the form to non-nullable in Angular
Video – How to know which @Input() changes in ngOnChanges👨‍💻 | SimpleChanges in Angular
Video- What gets called first ngOnInit or ngOnChanges in 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: It subscribes to an observable or aContinueContinue reading “Step-by-Step Understanding the Async Pipe”
Video – ngPlural Directive in AngularÂ
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. https://gist.github.com/debugmodedotnet/17b2ff1a9050ae4d9530fd75b99d99ce The above service is SingletonTree-shakeableAvailable throughout the application Singleton means Angular creates only one object of the AppService, regardless of how many places you use it. However, if youContinueContinue reading “Making Angular Service – Always Singleton”
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 thingsContinueContinue reading “The simplest way to disable console.log for Production build in Angular?”
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,ContinueContinue reading “Video – Angular Interview : is Angular Service Singleton ?”