Mayank Agarwal has Published 380 Articles

Node.js – dns.lookup() Method

Mayank Agarwal

Mayank Agarwal

Updated on 29-Oct-2021 07:31:40

549 Views

The dns.lookup() method resolves the host name (e.g., tutorialspoint.com) into the first found A IPv4) or AAAA (IPv6) record. The properties available under the options are optional. dns.lookup() does not have anything to do with the DNS protocol. The implementation uses an OS facility that can associate names with addresses ... Read More

Node.js – dns.resolveNs() Method

Mayank Agarwal

Mayank Agarwal

Updated on 29-Oct-2021 07:27:42

41 Views

The dns.resolveNs() method uses the DNS protocol to resolve the nameserver records (NS Records) for the hostname. The addresses argument passed to the callback function will contain an array of nameserver records for the hostname.Syntaxdns.resolveNs(hostname, callback)ParametersThe above parameters are defined as below −hostname – This parameter takes input for the ... Read More

Node.js – process.connected Property

Mayank Agarwal

Mayank Agarwal

Updated on 29-Oct-2021 07:24:49

59 Views

The process.connected property returns True if an IPC channel is connected and will return False after the process.disconnect() method is called. This happens only when the node process is spawned with an IPC channel (i.e., Child process and Cluster).Once the process.connected property is false, no messages can be sent over ... Read More

Node.js – Timers Module – Scheduling Timers

Mayank Agarwal

Mayank Agarwal

Updated on 27-Oct-2021 07:51:47

349 Views

The timers module contains functions that can execute code after a certain period of time. You do not need to import the timer module explicitly, as it is already globally available across the emulated browser JavaScript API.Timers module is mainly categorised into two categoriesScheduling Timers − This timer schedules the ... Read More

angularjs – ng-class Directive

Mayank Agarwal

Mayank Agarwal

Updated on 08-Oct-2021 13:45:35

555 Views

The ng-class Directive in angularjs allows the user to dynamically set the CSS classes on an HTML element by databinding an expression which will further represent all those classes to be added. The class is only added if the expression inside the ngClass Directive returns True, else it will not ... Read More

AngularJS – ng-mousedown Directive

Mayank Agarwal

Mayank Agarwal

Updated on 08-Oct-2021 13:33:17

246 Views

The ng-mousedown Directive in AngularJS basically specifies a custom event on mouse-down event. We can perform multiple functions whenever the mouse is pressed and the mouse-down event is called.Syntax..content..Example − ngMousedown DirectiveCreate a file "ngMousedown.html" in your Angular project directory and copy-paste the following code snippet.       ... Read More

AngularJS – ng-app Directive

Mayank Agarwal

Mayank Agarwal

Updated on 08-Oct-2021 13:23:32

259 Views

The ng-app Directive in AngularJS is used for auto-bootstraping of an AngularJS application. This directive gives the root element of the application and is generally placed near the root element of the page like on the  or tags. This directive declares the root context from where the application will ... Read More

AngularJS – angular.element() function

Mayank Agarwal

Mayank Agarwal

Updated on 08-Oct-2021 13:16:08

1K+ Views

The angular.element() method wraps the raw DOM element or the HTML string as a jQuery element. If jQuery is available or imported, angular.element is an alias for the jQuery function, else this method delegates to AngularJS’s built-in subset of jQuery called jQueryLite or jqLite.Syntaxangular.element(element)Example − Wrapping the DOM element using ... Read More

AngularJS – ng-copy Directive

Mayank Agarwal

Mayank Agarwal

Updated on 08-Oct-2021 12:53:46

221 Views

The ng-copy Directive in AngularJS is used for specifying any custom behaviour while copying the texts in input text fields. We can use this directive to call certain methods that will be triggered while the text is copied from the input field. This directive is supported by all types of ... Read More

AngularJS – equals() method

Mayank Agarwal

Mayank Agarwal

Updated on 08-Oct-2021 12:46:35

1K+ Views

The equals() method in AngularJS basically checks if two objects or two values are equal or not. This method supports value types, regular expressions, arrays, and objects. It will return True if the reference objects passed inside the function are equal, else it will return False.Syntaxangular.equals(value1, value2)Example − Check if ... Read More

Advertisements