let's explain object-oriented programming (OOP) concepts: 1. **Classes and Objects:** - Imagine a class as a blueprint or template for creating objects. For example, think of a class called "Car" that describes what a car is, such as its color, brand, and model. - Now, an object is like a specific instance created from that blueprint. So, if you have a class "Car", you can create objects like "MyCar", "YourCar", each with their own unique characteristics. 2. **Encapsulation:** - Encapsulation is like putting things in a box and only allowing access through certain ways. In OOP, it means bundling data (variables) and methods (functions) that work on the data together within a class. - For example, in our "Car" class, we might have variables like "color" and "model", and methods like "startEngine()" and "stopEngine()". These are encapsulated within the "Car" class. 3. **Inh
Posts
multi color initial(Avatars) if img not available in Angular it's work angular 2,4+ all versions
- Get link
- Other Apps
Today I will show two methods apply background-color in initial Method 1: here I will show dynamic colors using random calls step 1: create a component and define color array list in .ts file public circleColor: string; colors = [ '#6930c3 ', // French Violet '#0096c7', // Blue green '#FFFF5C', // Laser lemon '#FF3366', // Radical red '#F49F0A', // Tagrine '#25a550', // Green '#03312E', // Rich black ]; step 2: ngOnInit() { const randomIndex = Math.floor(Math.random() * Math.floor(this.colors.length)); this.circleColor = this.colors[randomIndex]; } step 3: In .html <div class="circle" [ngStyle]="{'background-color': circleColor }"> // change color // <img *ngIf="!showInitials && showComponent" src="{{photoUrl}}" onerror="showInitials " class="initials">{{ initials }}
Refresh an Angular Component without reloading the same Component
- Get link
- Other Apps
A short trick for refreshing data in the same Angular components. This snippet will work in Angular 2, 4, 5, 6, 7, 8, and 9. Here two method and you can add according to your needs you are working with Angular and need to refresh a component without navigation on another component without using window.location.reload() or location.reload() , you can use the following code in your project: 1. using constructor in the same page(component) reload: any; Then, add this code to the required component's constructor . this . router . routeReuseStrategy . shouldReuseRoute = function () { return false ; }; this . mySubscription = this . router . events . subscribe (( event ) => { if ( event instanceof NavigationEnd ) { // Trick the Router into believing it's last link wasn't previously loaded this . router . navigated = false ; } }); Make sure to unsubscribe from this mySubs
Basic git commands for every developers should know
- Get link
- Other Apps
If you're one of those developers who still don't use any version control system, I don't know how you're still managing to get all your work done. so now here I am providing some git commands and you can use also increase your knowledge and work proficiency. 1) git config Notes: To set your user name and email in the main configuration file. How to use git commands: To check your name and email type in git config --global user.name and git config --global user.email . And to set your new email or name git config --global user.name = “Bhuwan Paneru and git config --global user.email = “ bhuwanpaneru@yahoo.com ” 2) git init Notes: To initialise a git repository for a new or existing project. How to use git commands: git init in the root of your project directory. 3) git clone Notes: To copy a git repository from a remote source, it also sets the remote to the original source so that you can pull again. How to use git commands: git c
.NET Core vs .NET Framework: How to Pick a .NET Runtime for an Application
- Get link
- Other Apps
Is .NET Core the next big thing? We’ve been toying with it for a while now, and we tend to think that it is. In fact, we predict that there will be a huge demand for developers skilled in this technology in 2018-2019. But how does it differ from the .NET Framework, and what do you need to know to use them effectively? In this post, we’ll explain the main differences and offer some guidance on how to make the best use of each. Historically, the .NET Framework has only worked on Windows devices. The Xamarin and Mono projects worked to bring .NET to mobile devices, macOS, and Linux. .NET Core provides a standard base library that can now be used across Windows, Linux, macOS, and mobile devices (via Xamarin). There are four major components of .NET architecture: Common language specification (CLS) defines how objects are implemented so they work everywhere .NET works. CLS is a subset of Common Type System (CTS) — which sets a common way to describe all types. Framework class