There are four ways a function can be created in JavaScript. They are as follows: A function as a statementA function as an expressionA function as an arrow functionA function created using the Function constructor All four ways of function creation have distinct features such as an arrow function that does not have its own this object,Continue reading "Four Ways to Create a Function in JavaScript"
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, anyProviders useClass, useFactory, useValue, useExisting Global Error Handling Services in lazy loaded modules https://www.youtube.com/watch?v=OMqqh1eIeXE For more such videos subscribe to the channel here : https://www.youtube.com/c/geek97
Video – Simplifying Change Detection in Angular, ng-India Webinar recording
In this video, learn everything about Angular Change Detection https://www.youtube.com/watch?v=_Ilp3Wh8gyE&t=3s For more such videos subscribe to the channel here : https://www.youtube.com/c/geek97
When to use viewProviders in Angular – Simplified
I have often seen developers are confused about viewProviders property of the @Componnet decorator. This post explains to you about the viewProviders option. The viewProviders defines the set of injectable objects that are visible to its view, DOM children. They are not visible to the content children. At the component level, you can provide a service in two ways: Using the providers arrayUsing the viewProviders array. IfContinue reading "When to use viewProviders in Angular – Simplified"
A JavaScript function inside a Block Scope: Simplified
Scoping determines the visibility of a variable, an object, or a function. For example, a variable defined inside a function is visible or can be accessed only inside that particular function. JavaScript has 4 types of scope. Global scopeFunctional scopeLexical ScopeBlock Scope Out of the above four scoping, Block Scoping became part of JavaScriptContinue reading "A JavaScript function inside a Block Scope: Simplified"
How to use useClass with Tree Shakable Services in Angular
Recently, I was asked that how can we use providers such as useClass inside a Tree Shakable service? By default, Angular services are tree shakable, which means if the application does not use them, they are not part of the final bundle. So, if you create a service using CLI as, ng g s LogContinue reading "How to use useClass with Tree Shakable Services in Angular"
How to manually pass the value of ‘this’ object in a JavaScript function
Every JavaScript function has a ‘this’ object, and the value of ‘this’ object depends on the way you call the function. To pass the value of ‘this’ manually, you need to call the function indirectly. In JavaScript, you call a function indirectly to pass the value of ‘this’ object manually. Manually calling a function isContinue reading "How to manually pass the value of ‘this’ object in a JavaScript function"
Do Angular useExisting providers create a new object of service?
Short answer is NO, the useExisting provider use object created by other tokens. Read on, To learn more about such concepts, join a free webinar on Saturday, 20 June 4 PM IST. RSVP here: https://www.meetup.com/Geek97/events/271292371/ In Angular, providers determine how an object of a particular token gets created. That means whether Angular creates a newContinue reading "Do Angular useExisting providers create a new object of service?"
How to make a property non-enumerable in JavaScript?
By default, all the properties of JavaScript objects are enumerable. That means you can enumerate them in a for loop or read them using the Object.values(). Let us consider an object Dog as shown below, let Dog = { name :'foo', age: 9, canRun : true, eatMilk : false } You can enumerate all propertiesContinue reading "How to make a property non-enumerable in JavaScript?"
Video – Extension Method in C#
This video explains Extension Method in C# https://youtu.be/QIJNyvFWaUo