Thursday, 19 January 2017

ANGULARJS INTERVIEW QUESTIONS - Set 3


To Know more about the trending framework AngularJS, Visit AngularJS Training

21. Mention what are the characteristics of “Scope”?


To observer model mutations scopes provide APIs ($watch)
To propagate any model changes through the system into the view from outside of the Angular realm
A scope inherits properties from its parent scope, while providing access to shared model properties, scopes can be nested to isolate application components.
Scope provides context against which expressions are evaluated

22. Explain what is DI (Dependency Injection ) and how an object or function can get a hold of its dependencies ?


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 which is required to be configured when module gets loaded , the operation “config” uses dependency injection.

These are the ways that object uses to hold of its dependencies:
Typically using the new operator, dependency can be created
By referring to a global variable, dependency can be looked up
Dependency can be passed into where it is required

23. Mention what are the advantages of using Angular.js framework?

 

Advantages of using Angular.js as framework are:
=>
Supports two way data-binding
=>Supports MVC pattern
=>Support static template and angular template
=>Can add custom directive
=>Supports REST full services
=>Supports form validations
=>Support both client and server communication
=>Support dependency injection
=>Applying Animations
=>Event Handlers

 

 

 24. Explain the concept of scope hierarchy? How many scope can an application have?

 

Each angular application consist of one root scope but may have several child scopes. As child controllers and some directives create new child scopes, application can have multiple scopes. When new scopes are formed or created they are added as a children of their parent scope. Similar to DOM, they also creates a hierarchical structure.

25. Explain what is the difference between angular.js and backbone.js?

 

Angular.js combines the functionalities of most of the 3rd party libraries, it supports individual functionalities required to develop HTML5 Apps. While Backbone.js do their jobs individually.

26. Who created Angular JS ?

 

Intially it was developed by Misko Hevery and Adam Abrons. Currently it is being developed by Google.

27. What is Angular.js?

 

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.

28. Is AngularJS a framework, library or a plugin?

 

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.

29. Is it same as jQuery?


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 testability, templates and many more. Its like AngularJS like a toolbox and jQuery is just a tool.

30. How can we decrease digest cycle time ?


To decrease digest cycle time you need to decrease the number of watchers.

Below are some best practices you can follow to decrease number of watchers :-
=> Remove unnecessary watchers.
=> Use one time Angular binding. Especially if you see ng-repeat loop apply one time binding.
=> Work in batches.
=> Cache DOM
=> Use Web worker.
To Know more about the trending framework AngularJS, Visit AngularJS Training

3 comments:

  1. Thanks for sharing this AngularJS interview questions. It is really helpful to me and I have bookmarked this page for my future reference.
    Angularjs Training in Chennai | Angularjs course in Chennai | Angular 2 Training in Chennai

    ReplyDelete
  2. Greetings Mate,

    10/10 !!! Thank you for making your blogs an embodiment of perfection and simplicity. You make everything so easy to follow.

    I want discuss some problem which facing in my project.
    I have a large application with multiple modules and large database,
    which is developed in asp.net .
    We have done lots of changes on that so speed and reporting is very slow.
    So i want suggession to you. in my application,should i use angularjs or mvc.
    Once again thanks for your tutorial.

    Ciao,

    ReplyDelete
  3. Nice and good article.Thanks for sharing this useful information. If you want to learn Angular js course online, please visit below site.
    Angular js online training
    Angular js online course
    Angular js Online Training in Hyderabad
    Angular js Online Training in Bangalore
    Angular js Online Training in Chennai

    ReplyDelete