How to make “Banana in a box” input-output in your Angular component? some-component.ts @Component({ selector: ‘some-component’ }) export class SomeComponent […]
Updated on Kisan Patel
Here is the example of angular directive for sticky header that disappears when you scroll down. sticky.directive.ts import { Directive, […]
Updated on Kisan Patel
This sample uses the JsonIgnoreAttribute to exclude a property from serialization. public class Account { public string FullName { get; […]
Updated on Kisan Patel
How to serialize a class object into JSON format using the JsonConvert class. JsonConvert.SerializeObject(item) Note: you have to include the […]
Updated on Kisan Patel
Use labels to break from nested loops in JavaScript. In JavaScript you can specify labels. To break from a specific […]
Updated on Kisan Patel
You can easily remove duplicates from an array by converting it to a set and back to an array in […]
Updated on Kisan Patel
Problem: How to get an active element of your document if it can be in a shadow DOM? Solution: /** […]
Updated on Kisan Patel
Content Projection in #Angular allows you to operate multiple <ng-content> Use <ng-content select=”selector”> to separate content you get (selector can […]
Updated on Kisan Patel
How to remove an class in javascript? Solution 1: //remove a css class from an element document.getElementById(“myElementID”).classList.remove(“class_name”); Solution 2: document.getElementsByClassName(“legend”).style.display […]
Updated on Kisan Patel
How to Check if string contains a substring in JavaScript? javascript string contains Solution 1: var string = “foo”, substring […]
Updated on Kisan Patel