About AngularJs

  

Following are some of the multiple choice questions on the AngularJs with answers that will help the students in developing their knowledge.

AngularJs MCQ

1. What decorator is used to make a class a service?

  • Injector
  • Service
  • Injectable
  • Component

2. What is the quality that is not in Angular?

  • Directives
  • Pipes
  • Component
  • RoutingLink

3. Which of the following is not built-in pipe in Angular?

  • DatePipe
  • CurrencyPipe
  • DataPipe
  • PercentPipe

4. Which statements about metadata in angular are true

  • Meta-data is the way for processing the class and the component.
  • It is used to decorate the class
  • All the decorator are used by the meta-data to attach variable to the component or module class.
  • All of the above

5. Cons of SPA - Single Page Application

  • XSS
  • SEO
  • Lazy loading
  • Both a & b

6. Select all Structaral directives from below { (i) *ngIf } { (ii) *ngFor } { (iii) *ngClass } { (iv) *ngElse } { (v) *ngWhile } { (vi) *ngSwitch }

  • ii, iii, v
  • i, ii, iv
  • i, ii, vi
  • i, iii, v

7. Which are the different Data Types supported by Typescript?

  • Boolean var bValue: boolean = false
  • Number var age: number = 16
  • String var name: string = "jon"
  • All of the above

8. Which of the following is a valid AngularJS expression?

  • {{ 2 + 2 }}
  • { 2 + 2 }
  • (( 2 + 2 ))
  • { (2 + 2) }

9. Which of the following is true about ng-init directive?

  • ng-init directive initializes an AngularJS Application data.
  • ng-init directive is used to put values to the variables to be used in the application.
  • both
  • none

10. Which of the following directive bootstraps AngularJS framework?

  • ng-init
  • ng-app
  • ng-controller
  • ng-bootstrap

11. The . . . . . directive is used if you want to add or remove HTML elements from the DOM based on data in the model.

  • ng-switch
  • ng-model
  • ng-Disabled
  • ng-Cloak

12. AngularJS needs data in JSON format to populate its model.

  • yes
  • no

13. Which of the below commands are used for installing dependencies in Node

  • npm add dependencyName
  • npm i / install -g dependencyName
  • node i / install dependencyName
  • node i / install dependencyName

14. How many types of Data Binding are there?

  • 1 type
  • 2 type
  • 3 type
  • 4 type

15. If I write <button (click) = "onClick ()"> in a template, I use?

  • interpolation
  • property binding
  • event binding
  • none of the above

16. What is the @Output decorator for?

  • Share data from a parent component to a child
  • Share data from a child component to a parent
  • Use event binding
  • Use a service

17. We can apply multiple structural directives to a host element?

  • TRUE
  • FALSE

18. We can apply multiple attribute directives to a host element?

  • TRUE
  • FALSE

19. When you import RouterModule in a feature module (not Root module) which function would you use?

  • forRoot()
  • forFeature()
  • forModule()
  • forChild()

20. In AngulsrJS HTML document is loaded and evaluated first in the browser. Mean while in AngularJS _________ ?

  • JavaScript file is loaded
  • The angular global object is created
  • Your JavaScript which registers controller functions is executed
  • All of above

21. Which of the following directive allows us to use form?

  • ng-app
  • ng-form
  • ng-controller
  • ng-bind

22. AngularJS is a library?

  • true
  • false

23. Angular JS is Library or Framework?

  • Library
  • Framework

24. Most used CSS frameworks are

  • Bootstrap
  • Semantic UI
  • SASS
  • Foundation

25. What is Form Builder?

  • Function for generating reactive forms in run-time
  • Class for generating template-driven forms in run-time
  • Class for generating reactive forms in run-time
  • Function for generating template-driven forms in run-time

26. Who was Angular developed by?

  • Google
  • Facebook
  • Netflix
  • Angular

27. Which of these are all Angular directives?

  • NgIf,NgFor,NgLoop
  • NgClass,NgSwitch,NgDate
  • NgFor,NgSwitch,NgClass
  • NgClass,NgLoop,NgIf

28. What is the @Input decorator for?

  • Share data from a parent component to a child
  • Share data from a child component to a parent
  • Use event binding
  • Use a service

29. What mechanism is used to use a service in a component?

  • Dependency injection
  • Legacy
  • Polymorphism
  • none of the above

30. What does this syntax do? routerLink="/home"

  • It navigates to the component with a name matching the assigned string
  • It links a route to a service by matching the assigned string to a service class name
  • It links a route with data by matching the assigned string to a property name
  • It navigates to the component with a path matching the assigned string

31. What command will create a new Angular app with a root routing module?

  • ng generate my-dream-app
  • ng new my-dream-app --routing
  • ng generate my-dream-app --routing
  • ng new my-dream-app --module

32. What is the role of services in AngularJS and name any services made available by default?

  • AngularJS Services are objects that provide separation of concerns to an AngularJS app.
  • These can be created using a factory method or a service method.
  • Services are singleton components and all components of the application (into which the service is injected) will work with single instance of the service
  • All of the above

33. Which of the following is true about ng-include directive?

  • Embed HTML pages within a HTML page using ng-include directive
  • Embed JS files within a HTML page using ng-include directive
  • Both of the above.
  • None of the above.

34. Which architectures does angular use

  • MVC
  • MVVM
  • Component Based Architecture
  • All the above

35. What are the values assigned for datatype of void in TS ?

  • only null
  • only undefined
  • null and undefined
  • can assign any values (number, boolean etc)

36. What is Transpiler ?

  • converts source to source and then to binary
  • Source to Source Compiler
  • converts source to binary
  • All of above

37. What is the term Angular CLI?

  • Angular Command-line
  • Angular Command-line user interface
  • Angular Command-line interface
  • Angular Command-line interceptor

38. Is Typescript Stringly typed ?

  • Yes
  • No

39. Node JS use which javascript engine

  • Squirrel Fish
  • Bluma
  • V8
  • None of the above

40. Can an HTML page have multiple “ng-app” directive for bootstrapping multiple AngularJS application?

  • yes
  • no
  • none
  • all

41. Ng-controller directive

  • ng-controller directive tells AngularJS what controller to use with this view.
  • ng-controller directive binds the AngularJS Application data to HTML tags
  • ng-controller directive binds the values of AngularJS application data to HTML input controls
  • ng-controller directive defines and links an AngularJS application to HTML

42. Let x: [string, number];x = [10, "hello"];What will be the output of program ?

  • prints [ 'hello', 10 ]
  • gives error as belowType 'number' is not assignable to type 'string'.Type 'string' is not assignable to type 'number'.
  • prints output as shown belowhello10
  • prints [10, 'hello']

43. @Input() is used for sharing data between

  • from parent to child
  • from child to parent
  • both A and B
  • None of the above

44. AngularJS can show or hide HTML depending on the state of data in the model. You do so using a set of AngularJS directives such as . . . . . . which are created specifically for that purpose.

  • ng-show, ng-hide
  • ng-shown, ng-hidden
  • nt-show, nt-hide
  • ng-shows, ng-hides

45. What are the types of directives

  • Component
  • Structural
  • Attribute
  • All of above

46. Select the arrays included in the angular module

  • Bootstrap Array
  • Imports Array
  • Providers Array
  • All of the above

47. Which type of binding uses the banana box [()]

  • Property Binding
  • Interpolation Binding
  • Two-way binding
  • Directive Binding

48. Are you required to create an app rounting Module in an angular Application?

  • TRUE
  • FALSE

49. The minimum number of files you'll need to create an angular component

  • 1
  • 2
  • 3
  • 4

50. Http service supports following operations

  • Get, Post , Delete
  • Get, Post, Put
  • Get, Put, Post , Delete
  • Get , Post

Enjoyed the Quiz. Share this with friends

Comments

Add Your Review

Your email address will not be published.

Subscribe to Newsletter!

Subscribe to get latest updates and information.