AngularJS - Binding : double curly braces {{}} vs ng-bind directive

When AngularJS is initialized,loaded with module andknows with model to use for particular scope/code block it will start replacing all binding elements (e.g. curly braces, ng-bind) ng-bind: ng-bind elements are bindated as attribute to html element. If AngularJS is not loaded thenhtml element will be displayed without value. After angularJS module is loaded correct value will displayed on html element. Double Curly Braces: Double curly brace could be loaded anywhere on html If {{SomeDataAttribute}} placeholder forvalue of html element and if angularJS is not loaded then '{{SomeDataAttribu...

AngularJS - What are Modules?

AngularJS module is placeholder - a collection of services, directives, controllers, filters, and configuration information. Moduld is a declarative approache for re-using componet as an when required, makes unit and End-to-End test more easy. ...

AngularJS - How it works?

AngularJS will initialize when the DOM content is loaded. Looks for the ng-app directive – if its found, that is the root of the app Directives can be declared a variety of ways: typically with the ng- prefix (e.g. ng-controller) Load the module associated with the directive if specified When it knows with model to use for particular scope/code block it will start replacing all binding elements (e.g. curly braces, ng-bind) Uses Constructor Injection to pass dependences and decide order of initialization AnuglarJS Modularizeclient side code primarily into Model, View and Controller (MVC)....

AngularJS - What and Why?

What is AngularJS? AngularJS is front-end javascript framework Usedto create dynamic web pages Follows MVC pattern of development Its open source framework maintained by Google Uses declarative programming Does all sorts of client side operations like DOM manipulation, registaring callbacks, Updating UI based on data, input and filters Why we need AngularJS? AngularJS allows to doclient side code to be modularized, reusable and remove d Creating dynamic UI Decouple client side from server side Modularize application at client side Writing resuable code Manupulating DOM dynamically Do more work...

ASP.NET MVC - Show static .html files directly without controller

MVC framework provide support to static files e.g. images, css, js. Its just .html files are not configured by default. In order us to include static files in application we need to tell MVC application to allow Html file. routes.IgnoreRoute("StaticHtmls/{*path}"); After you include this in Route configuration files. You should be able to access all .html files in 'StaticHtmls' folder directly. e.g. http://YourSite/StaticHtmls/YourHtmlFile.html http://YourSite/StaticHtmls/YourHtmlFile.cshtml . ...

SOA - Investigating SOAP vs REST

REST SOAP Stands for: Representational State Transfer Protocol Simple Object Access Protocol What is it: RESTs sweet spot is when you are exposing a public API over the internet to handle CRUD operations on data. SOAPbrings its own protocol and focuses on exposing pieces of application logic (not data) as services. Addresses : Resource Method Transport Protocol Supported: Only supports HTTP. REST requires use of HTTP. SOAPcan be sent over almost any protocol such as HTTP, SMTP, TCP, or JMS. SOAPis Language, platform, and transport independent. Data vs Function Driven : REST is very data-driven...

SQL Server - Dynamically Convert Row Data Into Columns

Code Snippet: DECLARE @COLUMNHEADERS VARCHAR(MAX); SET @COLUMNHEADERS = STUFF( (SELECT DISTINCT ', [' + CAST(HIREDATE AS VARCHAR(255)) + ']' FROM EMPLOYEE FOR XML PATH(''), TYPE).VALUE('.', 'VARCHAR(MAX)') , 1, 2, ''); DECLARE @SQL NVARCHAR(MAX); SET @SQL = 'SELECT * FROM ( SELECT [DEPARTMENTID], [HIREDATE], [SORTNAME], ROW_NUMBER() OVER(ORDER BY (SELECT 1)) AS RN FROM EMPLOYEE ) T PIVOT ( MAX([SORTNAME]) FOR [HIREDATE] IN (' + @COLUMNHEADERS + ') ) P'; EXECUTE SP_EXECUTESQL @SQL; ...

ASP.NET - Check If Page / File / URL Exists

Code Snippet: using System.Net; /// Checks the file exists or not. /// The URL of the remote file. /// True : If the file exits, False if file not exists private bool CheckIfFileExists(string url) { try { //Create the HttpWebRequest and get web response and check status. If status code is HttpStatusCode.OK then return true otherwise false return (((HttpWebResponse)WebRequest.Create(url).GetResponse()).StatusCode == HttpStatusCode.OK); } catch { //Any exception will returns false. return false; } } . ...


OOPS - Deep drive into Overloading and Overriding

Overloading Overriding Polymorphism: Compile Time Polymorphism Run Time Polymorphism Binding: Early / Static Binding Late / Dynamic Binding Function Parameters: Functions with same name and different parameters. Functions in the extended class with same name and same parameters as in the base class, but with different behaviors. Code Snippet: public class A { public void Print(int x) { Console.WriteLine("Parent Method"); } } public class B : A { public void child() { Console.WriteLine("Child Method"); } public void Print(float x) { Console.WriteLine("Overload child met...

ASP.NET MVC - What is difference between Dynamic v. Strongly Typed Views?

There are three ways to pass information from a controller to a view in ASP.NET MVC 3 and above: As a strongly typed model object. @model IEnumarable<<MVCAppNamespace>.Controller.<ModelName>> @foreach (var item in Model) { } As a dynamic type (using @model dynamic) @model dynamic @foreach (var item in Model) { } Using the ViewBag @foreach (var item in ViewBag.<<ModelName>>) { } ...

ASP.NET MVC - How Routing Works?

How Request is handled in ASP.NET MVC: Is ten step process, as follows: App initialization- Browser request pages to IIS Perform routing - IIS will pass this request to Application UrlRoutingMoule will try to find Route defined in RouteTable Create MVC request handler- UrlRoutingMoule will try to find matching Route defined in RouteTable collection. If matching route found - MvcRouteHandler will create instance of MvcHandler Controller- Create controller- MvcHandler will create an instance of controller Execute controller - MvcHandler calls the controllers Execute method Invoke action - contro...

ASP.NET MVC - What are the benefits of using MVC?

Separation of application tasks -Easy to Manage - Manage complexity by dividing an application into the model, the view, and the controller Full control over the behavior of an application - as it doesn't use view state or server-based forms which will give full control to developer. Better support for test-driven development (TDD)- Easy to Test Best suited for large team An extensible and pluggable framework- You can plug in your own view engine, URL routing policy, action-method parameter serialization, and other components. The ASP.NET MVC framework also supports the use of Dependency I...

.NET Framework - Boxing and Unboxing

Now that we have seen difference between Value Types and Reference Types lets look at how can we convert value type to reference type and vice versa. Boxing Unboxing Conversion of: Value type to Reference type. Reference type to Value type. Process of : Boxing is the process of converting a value type to the type object or to any interface type implemented by this value type. Unboxing extracts the value type from the object. How it works: Boxing a value type allocates an object instance on the heap and copies the value into the new object. For the unboxing of value type to succeed at run time,...

ASP.NET MVC - Explain application life cycle?

Page Life cycle of an ASP.NET MVC: App initialization- Browser request pages to IIS Perform routing - IIS will pass this request to Application UrlRoutingMoule will try to find Route defined in RouteTable Create MVC request handler- UrlRoutingMoule will try to find matching Route defined in RouteTable collection. If matching route found - MvcRouteHandler will create instance of MvcHandler Controller- Create controller- MvcHandler will create an instance of controller Execute controller - MvcHandler calls the controllers Execute method Invoke action - controller determines which action method o...

ASP.NET MVC - What are features of the ASP.NET MVC Framework?

Separation of application tasks -Easy to Manage - Manage complexity by dividing an application into the model, the view, and the controller Full control over the behavior of an application - as it doesn't use view state or server-based forms which will give full control to developer. Better support for test-driven development (TDD)- Easy to Test Best suited for large team An extensible and pluggable framework- You can plug in your own view engine, URL routing policy, action-method parameter serialization, and other components. The ASP.NET MVC framework also supports the use of Dependency I...

ASP.NET MVC - Can we integrate MVC with ASP.NET?

Yes, The ASP.NET MVC framework is a lightweight, highly testable presentation framework that (as with Web Forms-based applications) is integrated with existing ASP.NET features, such as master pages and membership-based authentication. ...

ASP.NET MVC - Explain Page Life Cycle?

Page Lifecycle of anASP.NETMVC: App initialization-Browser request pages to IIS Perform routing -IIS will pass this request to Application UrlRoutingMoule will try to find Route defined in RouteTable CreateMVCrequest handler-UrlRoutingMoule will try to find matching Route defined in RouteTable collection. If matching route found - MvcRouteHandler will create instance of MvcHandler Controller- Create controller-MvcHandler will create an instance of controller Execute controller- MvcHandler calls the controllers Execute method Invoke action -controller determines which action method of the contr...

ASP.NET MVC - Can you explain the complete flow of MVC?

How Request is handled in ASP.NET MVC: ...


ASP.NET MVC - What is namespace for MVC framework?

The MVC framework is defined in the System.Web.Mvc namespace and is a fundamental, supported part of the System.Web namespace. ...

ASP.NET MVC - What are task of each MVC components?

Model- Model objects retrieve and store model state in a database, implement the business logic for the applications. View-Used to create user interface (UI) from model data. Controller-handle user interaction, work with the model, and ultimately select a view to render ...

ASP.NET MVC - What is MVC (Model view controller)?

Model-View-Controller (MVC) framework provides an alternative to the ASP.NET framework, which separates an application into three main components: the model, the view, and the controller (as shown). Figure 01: Invoking a controller action that expects a parameter value ...

OOPS - Access Modifier and Access Level C#

Access Modifier Access Level private The type or member can only be accessed by code in the same class. protected The type or member can only be accessed by code in the same class or in a derived class. internal The type or member can be accessed by any code in the same assembly, but not from another assembly. protected internal The type or member can be accessed by any code in the same assembly, or by any derived class in another assembly. public The type or member can be accessed by any other code in the same assembly or another assembly that references it. ...

.NET Framework - Value Types vs Reference Types

Value Types Reference Types Definition: A data type is a value type if it holds the data within its own memory allocation. A reference type contains a pointer to another memory location that holds the data. Includes: All numeric data types Boolean , Char, and Date All structures, even if their members are reference types Enumerations, since their underlying type is always SByte, Short, Integer, Long, Byte, UShort, UInteger, or ULong String All arrays, even if their elements are value types Class types, such as Form Delegates Holds Actual Data: Yes No Pointer to another memory location: No Yes ...

Scenario Based - Coding & Design Interview Questions With Answers;

How would you design spell checker application?Design application to see retaining user based on IIS Log?How would you design training portal?How you find max of all possible sequential permutation and combination of elements in Array and sequence no leading to max?...

SOA - SOAP - Simple Object Access Protocol

SOAP Stands for: Simple Object Access Protocol What is it: SOAPbrings its own protocol and focuses on exposing pieces of application logic (not data) as services. Addresses : Method Transport Protocol Supported: SOAPcan be sent over almost any protocol such as HTTP, SMTP, TCP, or JMS. SOAPis Language, platform, and transport independent. Data vs Function Driven : SOAPis strongly function-driven URL Structure / Metadata: URL structure depends on functionality. Operation / Function Dependability: For every operation need to write separate function / Method. Data formats Supported: SOAPsupportsXM...

SOA - REST (Representational State Transfer) Protocol

REST Stands for: Representational State Transfer Protocol What is it: RESTs sweet spot is when you are exposing a public API over the internet to handle CRUD operations on data. Addresses : Resource Transport Protocol Supported: Only supports HTTP. REST requires use of HTTP. Data vs Function Driven : REST is very data-driven, compared to SOAP, which is strongly function-driven. URL Structure / Metadata: In the REST paradigm, metadata is structured hierarchically and represented in the URI; this takes the place of the noun. Operation / Function Dependability: Operation depends on verbs. e.g. ht...

Source Control - Build systems

Most popular Source Control / Build systems are: VSS TFS Git Anthillpro, Sub Version ...

JS Frameworks - Libraries

Most used JS Framework / libraries are: JQuery, Bootstrap Angular Knockout Backbone DOJO ...

Testing - Automated Unit Testing Tools

Automated Unit Testing Tools are: NUnit ...