Convert Object's Array to an Array Using JavaScript

Saurabh Jaiswal
Updated on 21-Feb-2023 16:55:01

9K+ Views

We can use the Object.values() method, Array puch() method and for…of loop to convert Object’s array to an array using JavaScript. First we access each object using for…of loop and then apply the Object.values() method to access the values of individual object. Then use the Array push() method to add the values to the array. In this article, we will discuss in this approach in detail. Let’s have a look at the example to get an understanding about the problem. You have given an array of objects and the task is to convert the array of object into array ... Read More

Create Custom Directives in Angular 8

Sravani Alamanda
Updated on 21-Feb-2023 16:53:04

417 Views

In Angular, directives are one of the most important elements. Directives are building blocks like components in angular framework to build application. A directive used to modify the DOM by changing the appearance, behavior, or layout of DOM elements. Directives are used to provide or generate new HTML based syntax which will extend the power of the UI in an Angular Application. Each and every directive must have a selector same like a component. In simple words, every component in angular is a directive with the custom HTML template. In angular, we have directives to change the behavior or ... Read More

Convert JavaScript DateTime to MySQL DateTime

Saurabh Jaiswal
Updated on 21-Feb-2023 16:49:21

2K+ Views

Date time manipulation in JavaScript is important while dealing with databases. JavaScript Date and time are different from the MySQL date and time. JavaScript provides multiple ways to represent Date and time none of these formats are the same as MySQL's date and time format. In this article, we will discuss some approaches to converting JS date and time into MySQL date and time format. First of all, we will understand the difference between Javascript and MySQL date and time formats. Here is an example − Javascript − ISO 8601 Date Format : YYYY-MM-DDTHH:mm:ss.sssZ MySQL − ISO ... Read More

Add Event Listeners in HTML using AngularJS

Sravani Alamanda
Updated on 21-Feb-2023 16:47:58

4K+ Views

In AngularJS, events help us to perform particular tasks, based on the action. AngularJS is rich in events and has a simple model for adding event listeners to the HTML. AngularJS supports many events related to the mouse and keyboard. All these events are applied to the HTML elements. In angularJs, we have many HTML events. Suppose we write both AngularJS and HTML events simultaneously. AngularJS event and HTML event will be executed and AngularJS event will not overwrite the HTML event. Events can be represented by using directives. Like ng-click, ng-change, ng-mousedown, ng-mouseup, ng-keydown, ng-keyup, ng-keypress, ng-mouseover, ng-paste etc. ... Read More

Change Background Color of Canvas Text Using Fabric.js

Gungi Mahesh
Updated on 21-Feb-2023 16:17:32

673 Views

The fabric.Text is used to change the corner style of a canvas-type text. Text class of Fabric.js provides text abstraction by using the fabric.Text class, which allows us to work with text in an object-oriented way. Compared to the canvas class the Text class provides the rich functionality. The text object contains the different properties, but to change the background color and rendering the text of canvas can be done using one of the color property i.e., textBackgroundColor. By defining the value for the color property we change the background color. Syntax The following is the syntax for the fabric.Text ... Read More

Change Background Color of a Canvas Circle Using Fabric.js

Gungi Mahesh
Updated on 21-Feb-2023 16:15:48

682 Views

The Circle class of Fabric.js which is used to provide the circle shape by using the fabric.Circle object. The Circle object is used to provide the circle shape, and the circle is movable, and it can be stretched according to the requirements. For the stroke, color, width, height, and fill color the Circle is customizable. Comparing to the canvas class the Circle class provides the rich functionality. Here, we are using the backgroundColor property of Circle object for changing the background color of a canvas circle. We can change the background color by defining the value for the property. Syntax ... Read More

Change Corner Style of Canvas Type Text Using Fabric.js

Gungi Mahesh
Updated on 21-Feb-2023 16:07:21

414 Views

The fabric.Text object of Fabric.JS is used to change the corner style of a canvas-type text. Text class of Fabric.js provides the text abstraction by using the fabric.Text object, which allows us to work with text in an object-oriented way. Comparing to the canvas class the Text class provides the rich functionality. The text object contains the different properties, but to change the style of corner and rendering the text of canvas can be done using one of the style property i.e., cornerStyle. If the cornerStyle is default then it returns rect, otherwise the value is defined as a circle ... Read More

Change Font Weight of Canvas Text Using Fabric.js

Gungi Mahesh
Updated on 21-Feb-2023 16:02:16

419 Views

The fabric.Text object of Fabric.JS is used to change the corner style of a canvas-type text. Text class of Fabric.js provides the text abstraction by using the fabric.Text object, which allows us to work with text in an object-oriented way. Comparing to the canvas class the Text class provides the rich functionality. The text object contains the different properties, but to change the font-weight of a text canvas can be done using one of the font property i.e., fontWeight. The fontWeight property of a Fabric.js Text object specifies the weight or thickness of the text characters. It can be used ... Read More

Change Character Spacing of Text Canvas Using Fabric.js

Gungi Mahesh
Updated on 21-Feb-2023 15:59:57

814 Views

The fabric.Text object of Fabric.JS is used to change the corner style of a canvas-type text. Text class of Fabric.js provides the text abstraction by using the fabric.Text object, which allows us to work with text in an object-oriented way. Comparing to the canvas class the Text class provides the rich functionality. The text object contains the different properties, but to change the character spacing of a text canvas can be done using one of the property i.e., charSpacing. This property sets the spacing between characters in pixels. You can also use the setCharSpacing method to changing the spacing of ... Read More

Change Border Color of Canvas Text Using Fabric.js

Gungi Mahesh
Updated on 21-Feb-2023 15:58:10

702 Views

The fabric.Text object of Fabric.JS is used to change the corner style of a canvas-type text. Text class of Fabric.js provides the text abstraction by using the fabric.Text object, which allows us to work with text in an object-oriented way. Comparing to the canvas class the Text class provides the rich functionality. The text object contains the different properties, but to change the border color of a text canvas can be done using one of the color property i.e., borderColor. The borderColor property of a Fabric.js Text object specifies the border color of the object. Any valid CSS color value ... Read More

Advertisements