Arun A

1644581510

Customize the Enter and Shift+Enter Keys in Angular Rich Text Editor for Better Productivity

As a web developer, you might feel annoyed if you have to write code for the same element frequently. In that scenario, we can customize the behavior of the keyboard keys to create those elements more easily. This will help us speed up the development process and enhance our productivity.

The Syncfusion Angular Rich Text Editor is a feature-rich WYSIWYG HTML editor. It allows users to easily customize content. It has a variety of tools to edit and format rich content and return valid HTML markup or Markdown (MD) content. You can also insert images, links, tables, and lists with modular architecture.

In this blog, we focus on customizing the default behavior of element (tag) creation while pressing the Enter and Shift+Enter keys in the Angular Rich Text Editor.

https://www.syncfusion.com/blogs/post/customize-the-enter-and-shiftenter-keys-in-angular-rich-text-editor-for-better-productivity.aspx

What is GEEK

Buddha Community

Customize the Enter and Shift+Enter Keys in Angular Rich Text Editor for Better Productivity

Navigating Between DOM Nodes in JavaScript

In the previous chapters you've learnt how to select individual elements on a web page. But there are many occasions where you need to access a child, parent or ancestor element. See the JavaScript DOM nodes chapter to understand the logical relationships between the nodes in a DOM tree.

DOM node provides several properties and methods that allow you to navigate or traverse through the tree structure of the DOM and make changes very easily. In the following section we will learn how to navigate up, down, and sideways in the DOM tree using JavaScript.

Accessing the Child Nodes

You can use the firstChild and lastChild properties of the DOM node to access the first and last direct child node of a node, respectively. If the node doesn't have any child element, it returns null.

Example

<div id="main">
    <h1 id="title">My Heading</h1>
    <p id="hint"><span>This is some text.</span></p>
</div>

<script>
var main = document.getElementById("main");
console.log(main.firstChild.nodeName); // Prints: #text

var hint = document.getElementById("hint");
console.log(hint.firstChild.nodeName); // Prints: SPAN
</script>

Note: The nodeName is a read-only property that returns the name of the current node as a string. For example, it returns the tag name for element node, #text for text node, #comment for comment node, #document for document node, and so on.

If you notice the above example, the nodeName of the first-child node of the main DIV element returns #text instead of H1. Because, whitespace such as spaces, tabs, newlines, etc. are valid characters and they form #text nodes and become a part of the DOM tree. Therefore, since the <div> tag contains a newline before the <h1> tag, so it will create a #text node.

To avoid the issue with firstChild and lastChild returning #text or #comment nodes, you could alternatively use the firstElementChild and lastElementChild properties to return only the first and last element node, respectively. But, it will not work in IE 9 and earlier.

Example

<div id="main">
    <h1 id="title">My Heading</h1>
    <p id="hint"><span>This is some text.</span></p>
</div>

<script>
var main = document.getElementById("main");
alert(main.firstElementChild.nodeName); // Outputs: H1
main.firstElementChild.style.color = "red";

var hint = document.getElementById("hint");
alert(hint.firstElementChild.nodeName); // Outputs: SPAN
hint.firstElementChild.style.color = "blue";
</script>

Similarly, you can use the childNodes property to access all child nodes of a given element, where the first child node is assigned index 0. Here's an example:

Example

<div id="main">
    <h1 id="title">My Heading</h1>
    <p id="hint"><span>This is some text.</span></p>
</div>

<script>
var main = document.getElementById("main");

// First check that the element has child nodes 
if(main.hasChildNodes()) {
    var nodes = main.childNodes;
    
    // Loop through node list and display node name
    for(var i = 0; i < nodes.length; i++) {
        alert(nodes[i].nodeName);
    }
}
</script>

The childNodes returns all child nodes, including non-element nodes like text and comment nodes. To get a collection of only elements, use children property instead.

Example

<div id="main">
    <h1 id="title">My Heading</h1>
    <p id="hint"><span>This is some text.</span></p>
</div>

<script>
var main = document.getElementById("main");

// First check that the element has child nodes 
if(main.hasChildNodes()) {
    var nodes = main.children;
    
    // Loop through node list and display node name
    for(var i = 0; i < nodes.length; i++) {
        alert(nodes[i].nodeName);
    }
}
</script>

#javascript 

Christa  Stehr

Christa Stehr

1598940617

Install Angular - Angular Environment Setup Process

Angular is a TypeScript based framework that works in synchronization with HTML, CSS, and JavaScript. To work with angular, domain knowledge of these 3 is required.

  1. Installing Node.js and npm
  2. Installing Angular CLI
  3. Creating workspace
  4. Deploying your First App

In this article, you will get to know about the Angular Environment setup process. After reading this article, you will be able to install, setup, create, and launch your own application in Angular. So let’s start!!!

Angular environment setup

Install Angular in Easy Steps

For Installing Angular on your Machine, there are 2 prerequisites:

  • Node.js
  • npm Package Manager
Node.js

First you need to have Node.js installed as Angular require current, active LTS or maintenance LTS version of Node.js

Download and Install Node.js version suitable for your machine’s operating system.

Npm Package Manager

Angular, Angular CLI and Angular applications are dependent on npm packages. By installing Node.js, you have automatically installed the npm Package manager which will be the base for installing angular in your system. To check the presence of npm client and Angular version check of npm client, run this command:

  1. npm -v

Installing Angular CLI

  • Open Terminal/Command Prompt
  • To install Angular CLI, run the below command:
  1. npm install -g @angular/cli

installing angular CLI

· After executing the command, Angular CLI will get installed within some time. You can check it using the following command

  1. ng --version

Workspace Creation

Now as your Angular CLI is installed, you need to create a workspace to work upon your application. Methods for it are:

  • Using CLI
  • Using Visual Studio Code
1. Using CLI

To create a workspace:

  • Navigate to the desired directory where you want to create your workspace using cd command in the Terminal/Command prompt
  • Then in the directory write this command on your terminal and provide the name of the app which you want to create. In my case I have mentioned DataFlair:
  1. Ng new YourAppName

create angular workspace

  • After running this command, it will prompt you to select from various options about the CSS and other functionalities.

angular CSS options

  • To leave everything to default, simply press the Enter or the Return key.

angular setup

#angular tutorials #angular cli install #angular environment setup #angular version check #download angular #install angular #install angular cli

Arun A

1644581510

Customize the Enter and Shift+Enter Keys in Angular Rich Text Editor for Better Productivity

As a web developer, you might feel annoyed if you have to write code for the same element frequently. In that scenario, we can customize the behavior of the keyboard keys to create those elements more easily. This will help us speed up the development process and enhance our productivity.

The Syncfusion Angular Rich Text Editor is a feature-rich WYSIWYG HTML editor. It allows users to easily customize content. It has a variety of tools to edit and format rich content and return valid HTML markup or Markdown (MD) content. You can also insert images, links, tables, and lists with modular architecture.

In this blog, we focus on customizing the default behavior of element (tag) creation while pressing the Enter and Shift+Enter keys in the Angular Rich Text Editor.

https://www.syncfusion.com/blogs/post/customize-the-enter-and-shiftenter-keys-in-angular-rich-text-editor-for-better-productivity.aspx

Myriam  Rogahn

Myriam Rogahn

1598408100

How to Use Syncfusion’s React Rich Text Editor with React Redux Form

The Syncfusion React Rich Text Editor component is a WYSIWYG editor component that can be used to frame a UI form control. It works seamlessly with React Redux Form and can validate inputs in form fields.

This blog explains the procedure to merge our Rich Text Editor component with Redux Form fields to validate inputs. The following topics are covered in this blog:

What is Redux Form?

Redux is an open-source JavaScript library. It is used to develop UI components in React and Angular platforms. redux -form is a validation library that can be integrated into any React web application easily. It uses the Redux library to store field input values and higher-order components.

Refer to the redux-form documentation page to get more information.

Now, let’s see how to create a React app with Redux and integrate our React Rich Text Editor within it.

Getting started with create-react-app

To create a React application, follow these steps:

Step 1: Use the create-react-app command to install the NuGet package globally that we will use to create a basic React application.

npm i create-react-app -g

You can create the app in any directory by using the create-react-app command.

Step 2: Move to the directory where you want to create the application and run the following command. Here, I am naming this app RichTextEditor-Redux-Form.

create-react-app RichTextEditor-Redux-Form

Thus, we have created the application.

#essential js 2 #react #rich text editor #web #javascript #react rich text editor

Terry  Tremblay

Terry Tremblay

1603061820

Why Should You Integrate Syncfusion WinForms Spell Checker into Your Text Editor?

Syncfusion WinForms Spell Checker (SpellCheckerAdv) is used to check the spelling of text in WinForms applications using dictionary resources. It can be integrated with WinForms text editors to identify spelling mistakes in text and correct them. The control can ignore special words, add new terms to the dictionary, and use a custom dictionary to check spelling.

A text editor control is used for editing text, formatting content, finding and replacing text, and more.

You may ask, why should I integrate the Syncfusion WinForms Spell Checker in a text editor control?

With this spell checker, you can:

Let’s try using these features in the TextBox control by integrating the WinForms Spell Checker.

#c# #rich text editor #syncfusion #user interface #windows forms #desktop #localization #rich text editor #sneak peek #winforms