TYC Website Design and Application Development. Addis Ababa
Five rules to understand `this` in JavaScript.
One of the most confusing concepts in javascript is the usage of the keyword this. In most classical OOP like Java programming languages this is simply an instance of the class you are working on. However, in JavaScript, this could be many things. Here are simple five rules that always help me know what this […]
How I spent hours displaying objects from chips into a dropdown
The task of copying an object in JavaScript Yesterday, I had a simple user story at work. The user story was to simply display data that the user selects on an Angular Material chips input into an Angular Material dropdown. To be honest the data I was working with was a complex object from a […]
Inheritance and Prototypes in JavaScript
Things I didn’t realize existed in JavaScript In java every class inherits from a class called Object. This Object class has methods like toString() and equals() that other classes can use by default. That means, without defining such methods in themselves. Hence an object of Employee.java class can invoke the toString() function. And this is […]
Working with the current index in Angular ngFor
Angular ngFor directive helps us loop over an item and interpolate it in our template file. Most of the time we might also be interested to get the current index in Angular ngFor. Furthermore, we might be interested in whether the items are located on the even or odd index. Angular provides an easy way […]