Articles on Trending Technologies

Technical articles with clear explanations and examples

AngularJS – ngHref Directive

Mayank Agarwal
Mayank Agarwal
Updated on 08-Oct-2021 363 Views

The ngHref Directive in AngularJS solves the problem of replacing the markup when the link is broken which thus leads the system to return a 404 error. Instead of using markup like {{hash}} in an href attribute which will change or replace the markup value, we should use the ngHref directive since that link can be broken and thus leads to return a System Error.Syntax..content..Example − ngHref DirectiveCreate a file "ngHref.html" in your Angular project directory and copy-paste the following code snippet.           ngHref Directive                 ...

Read More

AngularJS – ngSelected Directive

Mayank Agarwal
Mayank Agarwal
Updated on 08-Oct-2021 245 Views

The ngSelected Directive in AngularJS sets the selected attribute element on the element to True. We can also write an expression inside the ngSelected with the only condition that it should evaluate to True.This special directive is necessary since interpolation cannot be used inside the selected attribute.Syntax..content..Example − ngSelected DirectiveCreate a file "ngSelected.html" in your Angular project directory and copy-paste the following code snippet.           ngSelected Directive                                    Welcome to Tutorials Point     ...

Read More

AngularJS – ng-switch Directive

Mayank Agarwal
Mayank Agarwal
Updated on 08-Oct-2021 687 Views

The ngSwitch directive in AngularJS conditionally swaps the DOM structure on the template based upon the scope expression. This directive can be used for showing or hiding elements based upon the switch cases.The HTML elements will be displayed only if the expression inside the ngSwitch directive evaluates to True, else it will remain hidden. This directive is supported by all the HTML elements.Syntax Contents... Contents... Contents... Example − ngSwitch DirectiveCreate a file "ngSwitch.html" in your Angular project directory and copy-paste the following code snippet. ...

Read More

AngularJS – isObject() method

Mayank Agarwal
Mayank Agarwal
Updated on 08-Oct-2021 714 Views

The isObject() method in AngularJS basically checks if a reference is an Object or not. This method will return True if the reference passed inside the function is an Object, else it will return False.Note − NULL values are not considered as an Object, but JavaScript arrays are objects.Syntaxangular.isObject(value)Example − Check if the reference is an Object or notCreate a file "isObject.html" in your Angular project directory and copy-paste the following code snippet.           angular.isObject()                               ...

Read More

AngularJS – isString() method

Mayank Agarwal
Mayank Agarwal
Updated on 08-Oct-2021 381 Views

The isString() method in AngularJS basically checks if a reference is a string value or not. This method will return True if the reference passed inside the function is a string, else it will return False.Syntaxangular.isString(value)Example − Check if the reference is a String or notCreate a file "isString.html" in your Angular project directory and copy-paste the following code snippet.           angular.isString()                                    Welcome to Tutorials Point             ...

Read More

AngularJS – ng-change Directive

Mayank Agarwal
Mayank Agarwal
Updated on 08-Oct-2021 932 Views

The ng-change directive in AngularJS evaluates a given expression whenever the user changes the input. On every change, the ngChange directive is fired and the expression is evaluated immediately. The JavaScript onChange event only triggers at the end of a change (when the user leaves the form element or presses the key).Note − This directive also requires ngModel to be present.Syntax..Content..Example − ngChange DirectiveCreate a file "ngChange.html" in your Angular project directory and copy-paste the following code snippet.           ngChange Directive                   ...

Read More

AngularJS – ng-keydown Directive

Mayank Agarwal
Mayank Agarwal
Updated on 08-Oct-2021 422 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 and copy-paste the following code snippet.           ngKeydown Directive                            .keyDown {             background-color: blue;             color: white; ...

Read More

C++ program to overload addition operator to add two matrices

Arnab Chakraborty
Arnab Chakraborty
Updated on 07-Oct-2021 4K+ Views

Suppose we have two matrices mat1 and mat2. We shall have to add these two matrices and form the third matrix. We shall have to do this by overloading the addition operator.So, if the input is like589679834763then the output will be131113131312To solve this, we will follow these steps −Overload the addition operator, this will take another matrix mat as second argumentdefine one blank 2d array vvDefine one 2D array vv and load current matrix elements into itfor initialize i := 0, when i < size of vv, update (increase i by 1), do:for initialize j := 0, when j < ...

Read More

C++ program to overload extraction operator

Arnab Chakraborty
Arnab Chakraborty
Updated on 07-Oct-2021 542 Views

Suppose we have a Person class with two attributes first_name and the last_name. It also has two methods called get_first_name() and get_last_name() to retrieve or set first name and last name respectively. We shall have to overload the extraction operator (

Read More

C++ program to find maximum of each k sized contiguous subarray

Arnab Chakraborty
Arnab Chakraborty
Updated on 07-Oct-2021 516 Views

Suppose we have an array with n elements and a value k. We shall have to find maximum value for each of the contiguous subarray of size k.So, if the input is like arr = [3, 4, 6, 2, 8], k = 3, then the output will be The contiguous subarrays of size 3 are [3, 4, 6], [4, 6, 2], [6, 2, 8], so the maximum elements are 6, 6 and 8.To solve this, we will follow these steps −Define one deque Qi of size kfor initialize i := 0, when i < k, update (increase i by 1), ...

Read More
Showing 48081–48090 of 61,297 articles
Advertisements