Skip to main content

Posts

Populate Dropdown List with Array Values in PHP

The below PHP function used to Populate HTML Dropdown List from Array Values. Function : <?php function rnsdrop_Array($arr,$selids,$title='Select'){     print"<option value='0'>".$title."</option>";     foreach($arr as $id =>$name) {     if($selids==$id && $id!=0)         print "<option value=\"".$id."\" selected>".stripslashes($name)."</option>\r\n";     else if($id!=0)         print "<option value=\"".$id."\">".stripslashes($name)."</option>\r\n";     } } ?>   The below example explains how to generate dropdown list with array values using simple PHP function.   Example: <?php $arr=array(0=>'-',1=>'East','West','North','South'); rnsdrop_Array($prop_facing, @$row['prop_facing'],"Select Property Fac

AngularJS interview questions - Part 2

Q11. What are templates in AngularJS? Ans: In Angular, templates are written with HTML that contains Angular-specific elements and attributes. Angular combines the template with information from the model and controller to render the dynamic view that a user sees in the browser. In other words, if your HTML page is having some Angular specific elements/attributes it becomes a template in AngularJS. Q12. What are directives in AngularJS? Ans: Directives are markers on a DOM element (such as an attribute, element name, comment or CSS class) that tell AngularJS to attach a specified behavior to that DOM element or even transform the DOM element and its children. When AngularJS finds the directive at the time of rendering then it attaches the requested behavior to the DOM element. Angular comes with a set of these directives built-in, like ngBind, ngModel, and ngClass. Q13. Can we create our own directives? Ans: YES . AngularJS allows us to create our own custom

AngularJS interview questions - Part 1

    Q1. What is AngularJS?   Ans: AngularJS is open source client side MV* (Model – View – Whatever) framework for creating dynamic web applications. It gives life to your static HTML and makes it dynamic with its magic. It extends HTML using directives, expression and data binding techniques to define a powerful HTML template. Q2. Is AngularJS a framework, library or a plugin?   Ans: The suitable answer is that its a framework. As its lightweight so people also get confused between library and framework.AngularJS is open source client side MVC framework for creating dynamic web applications. Q3. Is it same as jQuery?   Ans: NO . jQuery is great library for manipulating the DOM, providing better user experience with animations and effects. You can create website using jQuery but not a web application. jQuery is just a library to play around with HTML, where as AngularJS is a framework to build a dynamic web app as it supports two data binding, MVC, allow testa