Header Ads Widget

BCA Information

AngularJS Directives and Expressions

 1)AngularJS application expressions are pure JavaScript expressions.

   a. True

   b.Flase

2)Which of the following is the correct syntax for writing AngularJS expressions?

    a.expression)

    b.{{expression}}

    c.{{{expression}}}

     d.[expression]

3)Which of the following directive is used to bind the application data to the HTML view in AngularJS?

    a.ng-app directive
    b.ng-model directive
    c.ng-bind directive
    d.ng-init directive

4)Which directive is used to start an Angular application?
    a. ng-app

     b.ng-start

    c. ng-init

     d.ng-begin

5)Which of the following is not a core AngularJS directive.
     a.ng-app
     b. ng-model
     c. ng-bind
     d. ng-state

6)On which of the following types of components can we create a custom directive?
 
      a. Element directives
      b. Attribute
      c. CSS
      d. All of the above.

7)What will be the output for the following code?
<div ng-app="""" ng-init=""points=[1,15,19,2,40]"">  
<p>The output is {{ points[2] }}</p> 
</div>

      a.The output is 1
       b.The output is 15
       c.The output is 19
       d.The output is 2

 8)AngularJS expressions behave in same way as ng-bind directives.

    a.false

    b.true

9) Which of the following is true about AngularJS expressions?

      a. Expressions are used to bind application data to HTML.

      b.Expressions are written inside double braces like {{ expression}}.

      c. Expressions behave in the same way as ng-bind directives. 

      d. All of the above.

10) Which of the following is true about ng-bind directive?

      a. ng-bind directive binds the AngularJS Application data to HTML tags.

       b.ng-bind updates the model created by ng-model directive to be displayed in the html tag.

     c. ng-bind updates html control data when controller changes the model.

     d.All of the above.

11)Which of the following is true about ng-model directive?

  a.ng-model directive binds the values of AngularJS application data to HTML input controls.

 b.ng-model directive creates a model variable which can be used with the html page and within the container control having ng-app directive.

 c.Both of the above.

  d.None of the above.


 12)Which of the following is true about the ng-controller directive?

   a.ng-controller directive tells AngularJS what controller to use with this view.
  b. AngularJS application mainly relies on controllers to control the flow of data in the application.
  c. A controller is a JavaScript object containing attributes/properties and functions.
  d. All of the above.


13)Which of the following is true about the ng-init directive?

    a. ng-init directive initializes AngularJS Application data.
    b. ng-init directive is used to put values to the variables to be used in the application.
   c. Both of the above.
   d. None of the above.

14)Which of the following statement specifies the data-binding in AngularJS?

   a.Synchronization of data between the model and view components.

  b.Synchronization of data between the model and controller components.

  c.Synchronization of data between the controller and view components.

    d.None of the above

15)Which of the following template can be used to write AngularJS directives?
      a.Tag
      b.Attribute
      c.Class name
      d.All of the above

 16)Custom directives are used in AngularJS to extend the functionality of HTML.
   a.True
   b. False

17)Which of the following can be used as a prefix for a directive?
   a.ng-
    b.x- 
   c.data-
   d.All of the above

 18)can we use data-ng-, instead of ng-, if we want to make your page HTML valid?

a.Yes
b. No
c. Can be yes or no
d. Can not say

19)To initialize a variable or application data-----directives are used.

a.ng-read only

b.ng-bind

c.ng-init

d.both b and c

20)Angular js ng-click directives is used to define an angular------event for html elements.

a.click

b.focus

c.onblur

d.ng-app

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

a. Yes
b. No

22) Can angular applications (ng-app) be nested within each other? a. Yes 

b. No

23)What are various possible ways in which angular application can be initialized? 
a. On an element, one could either put simply the attribute such as (ng-app, data-ng-app, ng:app, x-ng-app)
 b. Put the named attribute such as (ng-app='demoApp')
 c. Both of the above
24)angular.module is primarily used to create application module. 
a. true 
b. false
25)You cannot use AngularJS directives to tell AnguluarJS how to mix the data into the HTML template.
 a.True
 b.False
26)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.
 a. ng-shown, ng-hidden 
b. ng-show, ng-hide
c.nt-show, nt-hide 
d.ng-shows, ng-hides
27)AngularJS expressions are written using. 
a.double braces like {{ expression}}
b.single braces like {expression} 
c. small bracket like (expression) 
d.capital bracket like [expression]
28)You can use the . . . .  directive, in order to bind the innerHTML of the element to the specified model property. 
a.ng-bind
b.ng-binding
 c.ng-binds
 d.ng-bindings
29)The ng-bind directive . . . . . . allow you to hide your template markup when the HTML content is shown to the user before it is processed by AngularJS. 
a.does
b.does not.
30)The . . . . . directive is used if you want to add or remove HTML elements from the DOM based on data in the model.
a.ng-switch 
b.ng-model
c. ng-Disabled 
d.ng-Cloak 









Post a Comment

0 Comments

Popular Posts

OOSE Notes
Angular Js Practical Slip