Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Angularjs interview-questions-answers

4,383 views

Published on

For dynamic web apps, AngularJS is a structural framework. HTML is allowed to use as the template language and it allows to extend HTML’s syntax to express the application’s components clearly.

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Angularjs interview-questions-answers

  1. 1. AngularJS Interview Questions & Answers February 1, 2018 | JanBask Training Want more awesome content? Sign up for our newsletter. SUBSCRIBE  » Interview Question & Answer » AngularJS Interview Questions & Answers AngularJS Interview Questions & Answers For dynamic web apps, AngularJS is a structural framework. HTML is allowed to use as the template language and it allows to extend HTML’s Trending Courses Salesforce Training Email ID  Salesforce QA BA Java Dotnet Others  Search.. Register Login  +1 908 652 6151Select Course PDFmyURL converts any url to pdf!
  2. 2. syntax to express the application’s components clearly. The data binding and dependency in Angular JS injection, removes the code without having to write the code. All these happen within the browser, making Angular JS an ideal partner with any server technology. The impedance mismatch between dynamic applications and static documents is often solved with: A library: a collection of functions used while writing web apps. Frameworks: a particular type of implementation of a web application, where the code fills in the details. AngularJS Interview questions for Freshers What is AngularJS? Explain what are the key features of AngularJS? Explain what is scope in AngularJS? Explain what is services in AngularJS? Is AngularJS a framework, library or a plugin? Explain what are directives? Mention some of the most commonly used directives in AngularJS application? Explain what is a string interpolation in Angular.js? VIEW ALL COURSES Trending Blogs Java Training .NET Training SQL Server Training BA Training QA Training Top AWS Interview Question and Answers May 9, 2017 A Comprehensive Study of Hyper-v Vs VMware Vs Virtualbox December 12, 2017 PDFmyURL converts any url to pdf!
  3. 3. Explain what is the injector? Explain what is a factory method in AngularJS? Who created Angular JS? AngularJs Interview questions for Experienced Explain the concept of scope hierarchy? How many scopes can an application have? Explain what is the difference between AngularJS and backbone.js? How to make an ajax call using Angular JS? What is the use of $routeProvider in AngularJS? What is $rootScope? How to add routing? What is a directive andwhat are the different types of Directive? What is linking function and what are the types of linking function? What is DI (Dependency Injection ) and how an object or function can get a hold of its dependencies? Explain what is Angular Expression? Explain what is the key difference between angular expressions and JavaScript expressions? Can we have nested controllers in AngularJS? Main features of Angular JS Subscribe Now Email ID Be the first of your friends to like this JanBask Training on Thursday Introduction Guide of Amazon Web Services: http://bit.ly/2Fp5yS4 #AWS #amazon #web #Service #learn #training JanBask Training Like Page Subscribe and Follow Top 30 Frequently asked Selenium Interview Questions and Answers October 5, 2017 Top 30 Salesforce Interview Questions and Answers July 28, 2017 PDFmyURL converts any url to pdf!
  4. 4. 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. It helps in writing a proper maintainable architecture, that can be tested with a client-side code. The framework design is developed on MVC (Model-View-Controller) Full-featured SPA (Single Page Application) framework is provided. Dependency Injection is supported. Two-way data binding is supported. provides routing features. Robust tests can be performed. Read: Automation Testing Interview Questions & Answers AngularJS interview questions and answers (Freshers) Q1). What is AngularJS? AngularJS is a framework used for creating single web page applications in javascript. It allows using HTML as the template language that enables to extend HTML’s syntax to express the components of the application clearly. Q2). Explain what are the key features of AngularJS? Subscribe Now Featured Blogs How To Download & Install Selenium IDE & WebDriver December 15, 2017 PDFmyURL converts any url to pdf!
  5. 5. The key features of AngularJS are Scope Controller View Model Services Data Binding Directives Testable Filters Q3). Explain what is scope in AngularJS? The application model is referred as scope, which acts between application controller and the view, in order to connect them. Scopes can watch expressions and propagate events and are arranged in the hierarchical structure which can also impersonate the Document Object Model(DOM) structure of the application. Q4). Explain what is services in AngularJS? PDFmyURL converts any url to pdf!
  6. 6. The services in AngularJS are the singleton objects or functions, used for carrying out speci c tasks. Angular JS holds business logic and these functions are known as controllers, directive, filters and so on. Q5). Is AngularJS a framework, library or a plugin? AngularJS is open source client-side MVC framework for creating dynamic web applications. Q6). Explain what are directives? Mention some of the most commonly used directives in AngularJS application? Anything that introduces new syntax, are called directives. They are like markers on the Document Object Model(DOM) element that incorporates a special behaviour to it.Directives are the most important components in AngularJS application. Some of the commonly used directives are ng- model, ng-bind, ng-repeat ng-App, ng-show etc. Q7). What is string interpolation in Angular.js? Using interpolate service, the compiler matches the text and attributes in the compilation process in order to check the embedded expressions. PDFmyURL converts any url to pdf!
  7. 7. These expressions are updated and registered as watches, as a part of the normal digest cycle. Q8). Explain what is the injector? An injector is a service locator as de ned by a provider, instantiate types, invoke methods and load modules. The injector is used to retrieve object instances. The single injector present per Angular application helps to look up an object instance by its name. Q9). Explain what is a factory method in AngularJS? The factory method is used for creating the directive. When compiler matches the directive for the rst time, the factory method is invoked once. The factory method is invoked using $injector.invoke. Read: Hibernate Interview Questions And Answers Q10). Who created Angular JS? Initially, Angular JS was developed by Misko Hevery and Adam Abrons and later developed by Google. PDFmyURL converts any url to pdf!
  8. 8. Angular JS interview questions and answers (Experienced) Q11). Explain the concept of scope hierarchy? How many scopes can an application have? Each angular application consists of a root scope,but can have several child scopes. The application can have multiple scopes as child controllers and directives create new child scopes. When new scopes are created they are added as children of their parent scope, they also create a hierarchical structure similar to DOM. Q12). Explain what is the difference between AngularJS and backbone.js? AngularJS combines the functionalities of most of the third party libraries and supports individual functionalities that are required to develop HTML5 Apps. Backbone.js acts individually. Q13). How to make an ajax call using Angular JS? To make ajax call, AngularJS provides ‘$http’ control which provides the service to read data from the server. A database call initiates the server to fetch the desired records. Once the data is ready, $http can be used to get PDFmyURL converts any url to pdf!
  9. 9. the data from the server in the following manner: functionstudentController($scope,$http){ varurl="data.txt"; $http.get(url).success(function(response){ $scope.students= response; }); } Q14). What is the use of $routeProvider in AngularJS? What is $rootScope? $routeProvider is the key service which sets the con guration of URLs, attaches a controller with the same and maps them to the corresponding HTML page or ng-template, The scope is a special JavaScript object, that contains the model data. The role of joining the controller with the views is done by scope. Model data is accessed via $scope object In controllers. $rootScope is the parent of all of the scope variables. Q15). How to add routing? PDFmyURL converts any url to pdf!
  10. 10. var app = angular.module("AngularApp", ['ngRoute']); app.config(['$routeProvider', function($routeProvider) { $routeProvider. when('/page1', { templateUrl: 'Modules/Page1/page1.html', controller: 'Page1Controller' }) . when('/page2', { templateUrl: 'Modules/Page2/page2.html', controller: 'Page2Controller' }) . otherwise ({ redirectTo: '/page1' }); } ]); Q6). What is directive and what are the different types of Directives? A behaviour or function is triggered during compilation process when speci c HTML constructs are encountered, this function is called as the directive. It is executed when the compiler encounters it in the DOM. Different types of directives are:- PDFmyURL converts any url to pdf!
  11. 11. Element directives Attribute directives CSS class directives Comment directives Read: Top Digital Marketing Interview Questions and Answers Q17). What is linking function and what are the types of linking function? Link combines the directives with a scope and produces a live view. Link function is responsible for registering DOM listeners as well as updating the DOM. It is executed after the template is cloned. Pre-linking function:Pre-linking function is executed before the child elements are linked. For DOM transformation,It is not considered as the safe way. Post linking function:Post linking function is executed after the child elements are linked. It is safe to do DOM transformation by post-linking function. Q18). What is DI (Dependency Injection) and how an object or function can get a hold of its dependencies? PDFmyURL converts any url to pdf!
  12. 12. DI or Dependency Injection is a software design pattern that deals with how code gets hold of its dependencies. In order to retrieve elements of the application, the operation “con g” uses dependency injection which is required to be configured when the module gets loaded. The ways that object use to hold of its dependencies are: Typically, dependency can be created using the new operator. Dependency can be looked up, by referring to a global variable. Dependency can be passed to where it is required. Q19). Explain what is Angular Expression? Explain what is the key difference between angular expressions and JavaScript expressions? Angular expressions are code snippets that are usually placed in the binding as in Javascript. {{expression}} The key difference between the JavaScript expressions and Angular expressions Context: Angular, the evaluation of expressions are done against a scope object, while in the Javascript, the evaluation of expressions is done against the global window PDFmyURL converts any url to pdf!
  13. 13. Forgiving: In Angular expression, evaluation is done by forgiving to null and unde ned, whereas in Javascript unde ned properties generates TypeError or ReferenceError No Control Flow Statements: in an angular expression Loops, conditionals or exceptions cannot be used Filters: one can use filters to format data before displaying it Q20). Can we have nested controllers in AngularJS? YES. We can create nested controllers in AngularJS. Nested controller are de ned in hierarchical manner while using in View. Take a look at below code. hierarchy is “MainCtrl –< SubCtrl -< SubCtrl1". [code lang="js"] <div ng-controller=”MainCtrl”> <p>{{message}} {{name}}!</p> <div ng- controller=”SubCtrl”> <p>Hello {{name}}!</p> <div ng-controller=”SubCtrl2″> <p>{{message}} {{name}}! Your username is {{username}}.</p> </div> </div> </div> [/code] About Author PDFmyURL converts any url to pdf!
  14. 14. Related Articles JanBask Training JanBask Training is a leading Global Online Training Provider through Live Sessions. The Live classes provide blended approach of hands on experience along with theoretical knowledge which is driven by certified professionals. Important VMware Interview Questions and Answers READ MORE » May 10, 2017 Top Oracle DBA Interview Questions and Answers READ MORE » June 5, 2017 Top Java Interview Questions and Answers READ MORE » June 1, 2017 Janbask Training About Us Blog Contact Us Join Us Become an Instructor Become a Learner Corporate Training Quick Links Term of Use Privacy Policy Disclaimer Follow Us YouTube Follow 137 Like PDFmyURL converts any url to pdf!
  15. 15. © 2017 JanBask Training. All rights Reserved. PDFmyURL converts any url to pdf!

×