- https://www.tatvasoft.com/blog/reactjs-best-practices/amp/
- https://www.edureka.co/blog/interview-questions/react-interview-questions/amp/
- https://www.coursedio.com/course/react-software-architecture/next-steps
- https://www.youtube.com/watch?v=NsKBZuagLcg&t=1290s
- https://www.youtube.com/watch?v=qOH2X5hciiA
Building and Deploying your Code with Azure Pipelines
The single-responsibility principle (SRP) is a computer-programming principle that states that every module, class or function in a computer program should have responsibility over a single part of that program's functionality, and it should encapsulate that part. All of that module, class or function's services should be narrowly aligned with that responsibility.
TypeScript complain “has no initializer and is not definitely assigned in the constructor” about constructors by returning constructed object
strictPropertyInitialization forces you to initialize all properties that are not optional in the constructor of the class. This check can be useful as it ensures that you don't get unexpected uninitialized properties. There are several ways to get around the error, the first two are the general way to do it, in your case only the last on applies (I include all for completeness):
Initialize the field
If you define the property as boolean if should be true or false initialize it when you declare the field or initialize it in the constructor:
class MyClass {
someField: boolean = false;
constructor() {
return { someField: true };
}
}
Make the field optional
If the field can be undefined, you should mark this in the field declaration either by using ? or typing the field as undefined|boolean
class MyClass {
//someField?: boolean;
someField: boolean | undefined;
constructor() {
return { someField: true };
}
}
Use a not null assertion
In your case since in the constructor you are actually not initializing the current object (this) but returning a new one, you can tell the compiler it is wrong about the error and use a not null assertion. This assertion is specifically introduced because there are limitations in strictPropertyInitialization checks and sometimes the compiler gets it wrong. For those cases you can override what the compiler thinks, but you have to be explicit about it:
class MyClass {
someField!: boolean;
constructor() {
return { someField: true };
}
}
Initially user may have created the local git repository.
sh $ git init
- This will make the local folder as Git repository,Link the remote branch:- Now challenge is associate the local git repository with remote master branch.
sh $ git remote add RepoName RepoURL
usage: git remote add [] - Test the Remote
sh $ git remote show
--->Display the remote name
sh $ git remote -v
--->Display the remote branches\ - Now Push to remote
sh $git add .
----> Add all the files and folder as git staged
sh $git commit -m "Your Commit Message"
- - - >Commit the message
sh $git push
- - - - >Push the changes to the upstream\
Question : PrimeNG Table filterGlobal TS2339: Property 'value' does not exist on type 'EventTarget'
Answer : Your HTML input should be like this
<input pInputText type="text" (input)="applyFilterGlobal($event, 'contains')" placeholder="Filter" />
and in your TS do this
applyFilterGlobal($event: any, stringVal: any) {
this.dt!.filterGlobal(($event.target as HTMLInputElement).value, 'contains');
}
if you get error for dt add below line
import { ViewChild } from '@angular/core';
import {Table} from 'primeng/table';
@ViewChild('dt') dt: Table | undefined;
GitLens & GitGraph Below snapshot highlights how gitlens is showing commit over time And the below picture is for the the amazing vivid GitGraph
var url = "http://localhost:8080/api/v1/users";
var data = {};
data.firstname = "John2";
data.lastname = "Snow2";
var json = JSON.stringify(data);
var xhr = new XMLHttpRequest();
xhr.open("PUT", url+'/12', true);
xhr.setRequestHeader('Content-type','application/json; charset=utf-8');
xhr.onload = function () {
var users = JSON.parse(xhr.responseText);
if (xhr.readyState == 4 && xhr.status == "200") {
console.table(users);
} else {
console.error(users);
}
}
xhr.send(json);
var url = "http://localhost:8080/api/v1/users";
var xhr = new XMLHttpRequest();
xhr.open("DELETE", url+'/12', true);
xhr.onload = function () {
var users = JSON.parse(xhr.responseText);
if (xhr.readyState == 4 && xhr.status == "200") {
console.table(users);
} else {
console.error(users);
}
}
xhr.send(null);
https://www.shawnmcgough.com/conflict-prevents-automatic-merging/
https://www.webfx.com/blog/marketing/what-is-ada-compliance/
https://stackoverflow.com/questions/56941545/buttontext-on-today-view-not-updating
//Inhertiance example
class person{
constructor(name,job){
this.name = name;
this.job =job;
}
//method to return the string
toString(){
return (`Name of person: ${this.name} --job ${this.job}` );
}
}
class student extends person{
constructor(name,job,id){
//super keyword to for calling above class constructor
super(name,job);
this.id = id;
}
toString(){
return (`${super.toString()},Student ID: ${this.id}`);
}
}
let student1 = new student('Sameera','developer',22);
console.log(student1.toString());
unamePattern = "^[a-z0-9_-]{8,15}$";
pwdPattern = "^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?!.*\s).{6,12}$";
mobnumPattern = "^((\\+91-?)|0)?[0-9]{10}$";
emailPattern = "^[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,4}$";
The “fatal: refusing to merge unrelated histories” Git error occurs when two unrelated projects are merged (i.e., projects that are not aware of each other’s existence and have mismatching commit histories).
Consider the following two cases that throw this error:
You have cloned a project and, somehow, the .git directory got deleted or corrupted. This leads Git to be unaware of your local history and will, therefore, cause it to throw this error when you try to push to or pull from the remote repository.
You have created a new repository, added a few commits to it, and now you are trying to pull from a remote repository that already has some commits of its own. Git will also throw the error in this case, since it has no idea how the two projects are related.
Solution The error is resolved by toggling the allow-unrelated-histories switch. After a git pull or git merge command, add the following tag:
git pull origin master --allow-unrelated-histories