Web Prepration

Web Concept Tutorials

Angular, Others

In this post, We are going to explain *ngFor and all features of *ngFor means local variables and find index etc. *ngFor NgFor is a structural directive, means, it changes the structure of the DOM Its point is to repeat a given HTML template once for each value in an array, each time passing it the array value as context for string interpolation or binding. The syntax is *ngfor=”let <value> of <collections>” <value> is variable name of your choosing, <collection> is property on your component which holds a collection, usually an array but anything that can be iterate over in a for loop. Example:-

  ngFor-local variables Index – Used for provide the index for current element while iteration. First –  Return true if current element is first element in the iteration otherwise false. Last — Return true if current element is last element in the iteration otherwise false.

read more >>
Angular, Others

In this post, I am going to explain “How to use ngSwitch in Angular5”, ngSwitch used in angular same as other programming language. In this article I will be show example “How to use ngSwitch in Angular”. ngSwitch ngSwitch is actually comprised of two directives, an attribute directive and a structural directive. Its very similar to a switch statement in JavaScript and other programming languages, but in the template. The ngSwitch directive lets you hide/show html element depending on expression We can also define a default section, by using the ng-switch-default directive, to show a section if none of the other sections get a match. Three things to keep in mind –ngSwitch, ngSwitchCase, ngSwitchDefault Example:-

  Thanks!! WebpreprationI’m a full-stack developer.  My hobby and profession to write blog and programming tips that helps to others. I am a great admirer of PHP, Laravel, Codeigniter, AngularJS,  Vue.js,  Javascript, JQuery, WordPress,

read more >>
Angular, Others

In this post, I am going to explain all conditional statement of Angular like NgIf, NgIf else, Then and Switch Statement. NgIf, else, Then NgIf conditionally includes a template based on the value of expressions It adds or removes the HTML element in DOM layout. The basic syntax of the ngif directives is simple and effective, all we need to do is prefix the directive name with an asterisk ( * ) and add it anywhere inside our template. *ngIf NgIf is an structural directive that can add or remove host element and its descendants in DOM layout at run time. It conditionally shows the inline template. NgIf works on the basis of true and false result of given expression. If condition is true, the elements will be added into DOM layouts otherwise they will be removed  

  *ngIf with else Else is used when we want to

read more >>