Mayank Agarwal has Published 380 Articles

AngularJS – ng-keydown Directive

Mayank Agarwal

Mayank Agarwal

Updated on 08-Oct-2021 09:20:38

242 Views

The ng-keydown directive in AngularJS basically specifies a custom event on pressing the key. We can perform multiple functions whenever the keydown event is called. This event also supports different types of elements like , and .Syntax..content..Example − ngKeydown DirectiveCreate a file "ngKeydown.html" in your Angular project directory ... Read More

AngularJS – ng-blur Directive

Mayank Agarwal

Mayank Agarwal

Updated on 06-Oct-2021 08:31:33

493 Views

The ng-blur Directive in AngularJS is fired when an element loses focus from that element. The blur event is executed synchronously along with the DOM manipulations (like removing from the focus point).AngularJS also executes the expression using scope.$evalAsync if the event is fired during an $apply to ensure the consistent ... Read More

How to convert a string into uppercase in AngularJS?

Mayank Agarwal

Mayank Agarwal

Updated on 06-Oct-2021 08:04:23

881 Views

Sometimes we may need to represent a name or a string in capital letters. To convert a string into uppercase in AngularJS, we can use the uppercase filter to change its case to uppercase.SyntaxIn HTML Template Binding{{uppercase_expression | uppercase}}In JavaScript$filter('uppercase')()Example − Conversion to Upper CaseCreate a file "uppercase.html" in your ... Read More

AngularJS – angular.isArray() Function

Mayank Agarwal

Mayank Agarwal

Updated on 06-Oct-2021 07:06:57

1K+ Views

The angular.isArray() function in AngularJS basically checks if a reference is an Array or not. This method will return True if the reference passed inside the function is an Array type, else it will return False.Syntaxangular.isArray(value)Example − Check if the reference is an Array or notCreate a file "isArray.html" in ... Read More

Express.js – app.METHOD() in Method

Mayank Agarwal

Mayank Agarwal

Updated on 01-Oct-2021 07:23:47

345 Views

app.METHOD() is used for mapping or routing an HTTP request where METHOD represents the HTTP method of the request such as GET, POST, PUT, etc., but in lowercase. Therefore, the methods are app.get(), app.post(), app.get(), and so on.Syntaxapp.METHOD(path, callback, [callback])Parameterspath − This is the path for which the middleware function ... Read More

Using next() function in Express.js

Mayank Agarwal

Mayank Agarwal

Updated on 01-Oct-2021 06:54:31

1K+ Views

Express.js is a powerful tool for building web servers to hit API at backend. It has several advantages which makes it popular, however it has got some drawbacks too, for example, one needs to define different routes or middleware to handle different incoming requests from the client.In this article, we ... Read More

Express.js – express.text() function

Mayank Agarwal

Mayank Agarwal

Updated on 01-Oct-2021 06:44:18

687 Views

express.text() is a built-in middleware function in Express. It parses the incoming request payloads into a string and it is based upon the body-parser. This method returns the middleware that parses all the bodies as strings.Syntaxexpress.text([options])ParametersFollowing are the different options available with this methodoptionsinflate – It enables or disables the ... Read More

Express.js – express.raw() function

Mayank Agarwal

Mayank Agarwal

Updated on 01-Oct-2021 06:37:28

2K+ Views

express.raw() is a built-in middleware function in Express. It parses the incoming requests into a buffer and it is based upon the body-parser. This method returns the middleware that parses all JSON bodies as buffer and only looks at the requests where the content-type header matches the type option.Syntaxexpress.raw([options])ParametersFollowing are the ... Read More

Express.js – express.json() function

Mayank Agarwal

Mayank Agarwal

Updated on 01-Oct-2021 06:32:10

15K+ Views

express.json() is a built-in middleware function in Express. This method is used to parse the incoming requests with JSON payloads and is based upon the bodyparser.This method returns the middleware that only parses JSON and only looks at the requests where the content-type header matches the type option.Syntaxexpress.json([options])ParametersFollowing are the ... Read More

Express.js – app.use() Method

Mayank Agarwal

Mayank Agarwal

Updated on 01-Oct-2021 06:25:03

11K+ Views

The app.use() method mounts or puts the specified middleware functions at the specified path. This middleware function will be executed only when the base of the requested path matches the defined path.Syntaxapp.use([path], callback, [callback])Parameterspath − This is the path for which the middleware function is invoked. A path can be ... Read More

Advertisements