AngularJS
- Sep 27, 2016
- 3 min read
AngularJS has been introduced by Google. It is a framework that helps you to create dynamic Web apps. Normally, AngularJS uses HTML as the backbone.
AngularJS creates extended HTML tags that can be used as normal HTML tags. These tags will help you to write an efficient code. The interesting fact is that you can reduce the lines of code you may need to write when you use normal JavaScript.
Hey guys, Let us discuss some of the commonly asked interview questions about AngularJS.
1.What is AngularJS? AngularJS is an open-source JavaScript framework developed by Google. It is a structural framework for dynamic Web apps. It is easy to update and get information from your HTML document. -This framework is developed on MVC (Model-View-Controller) design pattern. -It provides full featured SPA (Single Page Application) framework. -Application written in AngularJS is cross-browser compliant. AngularJS automatically handles JavaScript code suitable for each browser -It supports Dependency Injection. -It supports two-way data binding. -It provides routing features. -Testing was designed right from the beginning; so you can build robust tests. -Separation of the client side of an Application from the Server side. -The AngularJS framework uses Plain Old JavaScript Objects(POJO), it doesn’t need the getter or setter functions.
2.What is Scope in AngularJS? -Scope is object that refer to the model. They act as glue between controller and view. -Scope object contains both data and functions 3.What are Controllers in AngularJS? Controllers are Javascript functions which provide data and logic to HTML UI,
they control how data flows from the server to HTML UI.
4.What is data binding in AngularJS? Data binding is the automatic synchronization of data between model and view components. ng-model directive is used in data binding.
5.What is Service in AngularJS? services are functions that are responsible for specific tasks in an application. It provides many built in services, for example, $http, $route, $window, $location and so on. Each service is responsible for a specific task, for example, $http is used to make an Ajax call to get the server data. $route defines the routing information and so on. Builtin services are always prefixed with the $ symbol. 6.What is two-way data binding? Data binding in AngularJS is the synchronization between the model and the view. When data in the model changes, the view reflects the change, and when data in the view changes, the model is updated as well. This happens immediately and automatically, which makes sure that the model and the view is updated at all times.
7.What is Filter in AngularJS? Filter is used to formate data before displaying to the user. Filters can be added to expressions by using the pipe character |, followed by a filter 8.What are different type of Filter provided by AngularJS? AngularJS provides filters to transform data: currency Format a number to a currency format. date Format a date to a specified format. filter Select a subset of items from an array. json Format an object to a JSON string. limitTo Limits an array/string, into a specified number of elements/characters. lowercase Format a string to lower case. number Format a number to a string. orderBy Orders an array by an expression. uppercase Format a string to upper case. 9.What is Directives in AngularJS? AngularJS directives are only used to extend HTML and DOM elements' behavior. These are the special attributes,that start with ng- prefix, that tell AngularJS's HTML compiler ($compile) to attach a specified behavior to that DOM element.
10.What are expressions in AngularJS Expressions in AngularJS are like JavaScript code snippets. JavaScript code is usually written inside double braces: {{expression}}. Expressions are included in the HTML elements. AngularJS expressions can also have various valid expressions. We can use the operators between numbers and strings, literals, objects and arrarys inside the expression {{ }}.
For example,
{{ 2 + 2 }} (numbers) {{Name + " " + email}} (string) {{ Country.Name }} (object) {{ fact[4] }} (array)




Comments