HansR on the Web - All quiz questions on Angular
Updated: 14-03-2018 23:42:08h
topics: angular,software engineering, level: 100
What is a Pure Function?
Please select exactly one correct alternative.

Answer

A function without observable side effects. The function's result solely depends on it's input parameters.

Reading

Pure Functions
topics: angularjs, level: 100
What is AngularJS?
Please select exactly one correct alternative.

Answer

AngularJS is an open-source web application framework written in JavaScript, maintained by Google and a community of individual developers and corporations. It is designed for developing single-page applications (SPA's).

Reading

AngularJS
topics: angularjs,angular|scope, level: 100
What is meant by "scope" in AngularJS?
Please select exactly one correct alternative.

Answer

Scope refers to the application model. It acts like glue between application controller and the view. Scopes are arranged in hierarchical structure and impersonate the Document Object Model (DOM) structure of the application. It can watch expressions and propagate events.
topics: angularjs,angular|directives, level: 100
Which of the statements on AngularJS Directives below are correct?
Please select exactly one or more correct alternatives.

Answer

All statements on AngularJS Directives are correct.
topics: angularjs,angular|directives, level: 100
What are AngularJS Directives?
Please select exactly one correct alternative.

Answer

AngularJS directives are HTML attributes with an "ng" prefix, like ng-init, ng-app and ng-model.
topics: angularjs,angularjs|patterns,patterns, level: 100
What are advantages of Single Page Applications?
Please select exactly one or more correct alternatives.

Answer

During usage of the web application, the page is dynamically changed, and resources are dynamically loaded and added to the page as necessary without the page being reloaded. This results in a more fluent user experience compared to classic web pages.
topics: angularjs,angular|http, level: 100
What happens?
Please select exactly one correct alternative.

Answer

None of the above is the correct answer because the application throws an error because you have to use a web server (and the http protocol) to load the "data.json" data file.

Reading

$http
topics: angularjs,angularjs|patterns,patterns, level: 100
What does MVVM stand for?
Please select exactly one correct alternative.

Answer

MVVM stands for Model View ViewModel. It is a solution pattern allowing to develop applications with loose coupling and separation of concern which in turn improves testability, maintainability and extendibility of the software.
topics: angularjs,angularjs|patterns,patterns, level: 100
What does MVP stand for?
Please select exactly one correct alternative.

Answer

MVP stands for Model View Presenter. It is a solution pattern allowing to develop applications with loose coupling and separation of concern which in turn improves testability, maintainability and extendibility of the software.
topics: angularjs,angular|services, level: 100
When should you use AngularJS services?
Please select exactly one correct alternative.

Answer

In AngularJS "services" are the Singleton objects or functions that are used for carrying out specific tasks. It holds some business logic and these function can be called as controllers, directive, filters and so on. You use them for implementing specific functionality that is used regularly in your JavaScript code. This makes your controllers' code "lean".

Reading

No resources given.
topics: angularjs,angularjs|patterns,patterns, level: 100
What is a Single Page Application?
Please select exactly one correct alternative.

Answer

A single-page application is a web site that fits on a single web page. Using AngularJS, you can create Single Page Applications.
topics: angularjs,angular|data binding, level: 100
What is AngularJS "binding" or "data binding"?
Please select exactly one correct alternative.

Answer

Data binding is the automatic synchronization (update)of data between the model and view components. The view is a projection of the model at all times. When the model changes, the view reflects the change, and vice versa. So when you update a control's value and this control is bound to a variable, the variable is changed automatically as well.

Reading

Data Binding
topics: angularjs|exception management, level: 100
What does
$setValidity()
do?
Please select exactly one correct alternative.

Answer

It changes the validity state, and notify the form.This method can be called within $parsers/$formatters or a custom validation implementation.
topics: angularjs|scope, level: 100
What is meant by
$$phase
?
Please select exactly one correct alternative.

Answer

A method that AngularJS uses to start the digest cycle.
topics: angularjs|scope, level: 100
Why should you use $scope variables instead of regular JavaScript (var) variables?
Please select exactly one correct alternative.

Answer

Because AngularJS keeps track of $scope variables.
topics: angularjs|scope, level: 100
What are differences between
$scope
and
$rootScope
?
Please select exactly one or more correct alternatives.

Answer

Each Angular application has exactly one root scope, but may have several child scopes. When Angular evaluates {{name}}, it first looks at the scope associated with the given element for the name property. If no such property is found, it searches the parent scope and so on until the root scope is reached.
topics: angularjs|scope, level: 100
What are differences between
$apply
and
$digest
?
Please select exactly one correct alternative.

Answer

On $digest, AngularJS evaluates the scope model. On $apply, AngularJS triggers a $digest cycle. If an expression is passed to $apply(), it is evaluated first, before $digest() is executed.
topics: angularjs|scope, level: 100
What is a digest cycle?
Please select exactly one correct alternative.

Answer

The digest cycle processes all of the watchers of the current scope and its children. Because a watcher's listener can change the model, the $digest() keeps calling the watchers until no more listeners are firing.
topics: angularjs|scope, level: 100
What is the purpose of
$watch()
?
Please select exactly one correct alternative.

Answer

It registers a listener callback to be executed whenever the watchExpression changes.
topics: angularjs|scope, level: 100
What is the purpose of
$digest()
?
Please select exactly one correct alternative.

Answer

Processes all of the watchers of the current scope and its children.
topics: angularjs|scope, level: 100
What is the purpose of
$apply
?
Please select exactly one correct alternative.

Answer

$apply() is used to execute an expression in angular from outside of the angular framework.
topics: angularjs,angularjs|patterns,patterns, level: 100
What does MVC stand for?
Please select exactly one correct alternative.

Answer

MVC stands for Model View Controller. It is a solution pattern allowing to develop applications with loose coupling and separation of concern which in turn improves testability, maintainability and extendibility of the software.
topics: angularjs,angular|services, level: 100
What is the purpose of the AngularJS
$injector
service?
Please select exactly one or more correct alternatives.

Answer

The $injector service is used to retrieve object instances as defined by provider, instantiate types, invoke methods, and load modules.

Reading

$injector
topics: angularjs,angularjs|promise, level: 100
What is an AngularJS promise?
Please select exactly one correct alternative.

Answer

An AngularJS promise (or just a JavaScript promise) is a way for handling asynchronous operations.
topics: angularjs,angularjs|directives, level: 100
What is the default behaviour of the
ng-init
directive?
Please select exactly one correct alternative.

Answer

The ng-init directive initializes application data.
topics: angularjs,angular|scope, level: 100
Which of the statements below are correct on AngularJS scopes?
Please select exactly one or more correct alternatives.

Answer

Each AngularJS application consist of one (1) root scope but may have several child scopes. As child controllers and some directives create new child scopes, the application can have multiple scopes. When new scopes are formed or created, they are added as a children of their parent scope. This is similar to DOM in which a hierarchical structure can be created as well.

Reading

No resources given.
topics: angularjs,angular|dependencies, level: 100
In what way(s), an object or function can get a hold of its dependencies?
Please select exactly one or more correct alternatives.

Answer

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

Reading

No resources given.
topics: angularjs,angular|scope, level: 100
Which of the statements below on AngularJS scopes are valid?
Please select exactly one or more correct alternatives.

Answer

Please read the documentation mentioned in the resources.

Reading

Angular form
topics: angularjs,angular|css, level: 100
Which of the statements below on CSS classes added to AngularJS forms are valid?
Please select exactly one or more correct alternatives.

Answer

AngularJS ngModel adds these CSS classes to allow styling of form as well as control:
  • ng-valid is set if the form is valid.
  • ng-invalid is set if the form is invalid.
  • ng-pristine is set if the form is pristine.
  • ng-dirty is set if the form is dirty.
  • ng-submitted is set if the form was submitted.

Reading

Angular form
topics: angularjs,angularjs|patterns, level: 100
What is Dependency Injection?
Please select exactly one correct alternative.

Answer

Dependency Injection (DI) is a software design pattern that deals with how components get hold of their dependencies. The Angular injector subsystem is in charge of creating components, resolving their dependencies, and providing them to other components as requested.
topics: angularjs,angular|factories, level: 100
What is the factory method in AngularJS?
Please select exactly one correct alternative.

Answer

For creating a directive, the factory method is used. It is invoked only once, when compiler matches the directive for the first time. By using $injector.invoke the factory method is invoked.
topics: angularjs,angular|services, level: 100
What is meant by "services" in AngularJS?
Please select exactly one correct alternative.

Answer

In AngularJS "services" are the Singleton objects or functions that are used for carrying out specific tasks. It holds some business logic and these function can be called as controllers, directive, filters and so on.
topics: angularjs, level: 100
What is the difference between linking and compiling in AngularJS?
Please select exactly one correct alternative.

Answer

The compile function is used for template DOM manipulation and collect all of the directives. The link function is used for registering DOM listeners as well as instance DOM manipulation. It is executed once the template has been cloned.

Reading

No resources given.
topics: angular, level: 100
Which of the following is true about ng-controller directive?
Please select exactly one correct alternative.

Answer

ng-controller directive tells AngularJS what controller to use with this view. AngularJS application mainly relies on controllers to control the flow of data in the application. A controller is a JavaScript object containing attributes/properties and functions. Each controller accepts $scope as a parameter which refers to the application/module that controller is to control.

Reading

No resources given.
topics: angularjs, level: 100
What is AngularJS linking?
Please select exactly one correct alternative.

Answer

Linking combines the directives with a scope and produce a live view. For registering DOM listeners as well as updating the DOM, the link function is responsible. After the template is cloned it is executed.
There are two linking functions:
  • Pre-linking function: Pre-linking function is executed before the child elements are linked. It is not considered the safe way for DOM transformation.
  • 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

Reading

HTML Compiler
topics: angularjs,angular|compiler, level: 100
In which order AngularJS compiles HTML?
Please select exactly one correct alternative.

Answer

Compilation of HTML process occurs in the following steps:
  • Using the standard browser API, first the HTML is parsed into DOM
  • By using the call to the $compile() method, compilation of the DOM is performed. The method traverses the DOM and matches the directives.
  • Link the template with scope by calling the linking function returned from the previous step

Reading

HTML Compiler
topics: angularjs,angularjs|interpolation, level: 100
What is string interpolation in AngularJS?
Please select exactly one correct alternative.

Answer

In AngularJS, during the compilation process the compiler matches text and attributes using the interpolate service to see if they contains embedded expressions. As part of the normal digest cycle, these expressions are updated and registered as watches.

Reading

$interpolate
topics: angularjs,angular|routing, level: 100
What is the purpose of AngularJS routes?
Please select exactly one correct alternative.

Answer

AngularJS routing enables to create different URLs for different content in your web application. Each URL in AngularJS is called a route. Having different URLs for different content enables the user to bookmark URLs to specific content, and share those URLs with others, for example:
  • http://angularsap.nl/index.html#contact
  • http://angularsap.nl/index.html#news
  • http://angularsap.nl/index.html#people
topics: angularjs,angular|data binding, level: 100
What is Angular Protractor and what is it used for?
Please select exactly one correct alternative.

Answer

Protractor is an end-to-end test framework for AngularJS applications. Protractor runs tests against your application running in a real browser, interacting with it as a user would.
topics: angularjs,angular|data binding, level: 100
What is the difference between one way binding and two way binding?
Please select exactly one correct alternative.

Answer

In one way binding, changes in the model will be reflected in the view. In addition to this, in two way binding, changes in the view will be reflected in the model.

Reading

Data Binding
topics: angularjs,angular|directives, level: 100
Which statements are correct on AngularJS directives?
Please select exactly one or more correct alternatives.

Answer

An AngularJS directive is like a marker on a DOM element which attaches a special behavior to it. Directives are markers on a DOM element (such as an attribute, element name, comment or CSS class) that tell AngularJS's HTML compiler ($compile) to attach a specified behavior to that DOM element or even transform the DOM element and its children.
topics: angularjs,angular|expressions, level: 100
What are valid differences between AngularJS expressions and JavaScript expressions?
Please select exactly one or more correct alternatives.

Answer

All of the statements above are correct.
topics: angularjs,angular|expressions, level: 100
What is an AngularJS "expression"?
Please select exactly one correct alternative.

Answer

AngularJS expressions are JavaScript-like code snippets that are usually placed in bindings such as {{ expression }}. There are, however, some differences with JavaScript expressions.
topics: angularjs,angular|compiler, level: 100
What is the purpose of the AngularJS
$injector
service?
Please select exactly one correct alternative.

Answer

The $injector service is used to retrieve object instances as defined by provider, instantiate types, invoke methods, and load modules.

Reading

$injector
That's all folks!

Congratulations, you've made it to the end! I'll try to add more questions and topics on a regular basis.

More questions?

If you have enjoyed the quiz and you want more, you can select other tests by clicking the green buttons below.

Other resources

There are many quizzes and learning resources on the internet. Below you'll links to a selection of these. I'll add more. Quizzes from others
Learning resources
Take a look at my blog

Contact

Please contact me for feedback, suggestions and questions. hansrontheweb@live.com
Other quizzes

all topics
latest questions
html
css
javascript
jquery
bootstrap
architecture
software engineering
c#
sharepoint
xml
powershell
angular