Inheritance by using Virtual and Override Keyword

Parameterized Constructor Inheritance

Common Errors while Inheritance

Software development is not a Jenga game.
if...else
syntax in component HTML templates<ng-template #fetching> <p>Fetching... </ng-template> <p *ngIf="auth | async; else fetching; let user"> {{user.username }} </p>
In Angular 2 Animation were in library @angular/core
since angular 4 it separately maintained in @angular/animations
let x = String | null let y = Number | undefined let z = Array<String> | null | undefined
The User Credential are stored at client and sent to the token service which returns the token. Collecting and storing credential is the job of the token service doing it in client is consider not safe.The User Credential are stored at client and sent to the token service which returns the token. Collecting and storing credential is the job of the token service doing it in client is consider not safe.
This grant is only used in legacy scenario.
Implicit flow is commonly user when a client is javascript application a browser.
Here browser issue for Token to Token Service without explicitly providing client credential then a redirection occurs to a login page that is served by Token Service.
This approaches often has a security issue
Authorization Code solves the security problem. It needs a web server Application i.e. the client.
Hear browser get a code back from Token Service and that browser send that code to Client(Web Server) Then client sends the code to Token Service and get the Token back.
When you iterate over an array or collection most probably you use ngFor
directive to bind the data of collection into your DOM elements.
Here the big problem is, If at some point of time you wish to change the data in the collection, for example maybe as a result of an API request, Then the Angular can’t keep track of items in the collection and has no knowledge of which items have been removed or added as a results it creates the DOM again. That means this has a lot of DOM manipulations.
Here comes the solution, ngFor
directive has a property called track by
.
So what do these do? They help Angular to associate key with the DOM elements and tracks which items are added or removed.
Angular’s ngFor defaults tracks object identity for you, which is fast, but it can be more faster if we use track by
unique object ID in ngFor. Now when you change the collection, Angular can track which items have been added or removed according to the unique identifier and create or destroy only the things that changed.
<li *ngFor="let student of students; trackBy: student.id;"> ... </li>
Optionally, we can use track by index but that is not advisable as the index may be subject to change if you reorder your collection. Using a unique identifier allows Angular to locate that DOM node associated with the object much faster
You have been given a String S
consisting of uppercase and lowercase English alphabets. You need to change the case of each alphabet in this String. That is, all the uppercase letters should be converted to lowercase and all the lowercase letters should be converted to uppercase. You need to then print the resultant String to output.
using System; using System.Numerics; public static class InvertStringExtension { public static string Invert(this string s) { char[] chars = s.ToCharArray(); for (int i = 0; i < chars.Length; i++) chars[i] = chars[i].Invert(); return new string(chars); } public static char Invert(this char c) { if (!char.IsLetter(c)) return c; return char.IsUpper(c) ? char.ToLower(c) : char.ToUpper(c); } } class MyClass { static void Main(string[] args) { var line1 = System.Console.ReadLine().Trim(); System.Console.WriteLine(line1.Invert()); } }
The decision "What database to use" is a bit difficult. Most Startup rely on NoSQL Database. MongoDB is the most popular NoSQL DataBase. NoSQL Database has grown in popularity due to it's open source, flexible in nature and ease to use.
As Database is mostly representation of real world entities relationship is very important to be maintain among database. While MongoDB is not a relational database, there are two recommended approaches to representing relationships between entities.
In this approach we embed the related document inside its parent document.
{ "_id":ObjectId("52ffc33cd85242f436000001"), ... "address": [ { "building": "22 A, Indiana Apt", ... }, { "building": "ABC Apart", ... } ] }
This approach maintains all the related data in a single document, which makes it easy to retrieve and maintain. But The drawback is it is not Consistent. And if the embedded document keeps on growing too much in size, it can impact the read/write performance.
In this approach the two related table are maintained saperatly and the reference of one table is maintained in another table by its document id
{ ... "address_ids": [ ObjectId("52ffc4a5d85242602e000000"), ObjectId("52ffc4a5d85242602e000001") ] }
The benefit of this approach is whenever a document is updated, there is no overhead of managing other document because the reference ids does not change and the problem of Consistency is solved.