AngularJS 1.x Routers and Custom Directives MCQ solution | TCS Fresco Play
Disclaimer: The primary purpose of providing this solution is to assist and support anyone who are unable to complete these courses due to a technical issue or a lack of expertise. This website's information or data are solely for the purpose of knowledge and education.
Make an effort to understand these solutions and apply them to your Hands-On difficulties. (It is not advisable that copy and paste these solutions).
All Question of the MCQs Present Below for Ease Use Ctrl + F with the question name to find the Question. All the Best!
If you found answer for any of the questions is wrong. Please do mention in the comment section, could be useful for others. Thanks!
_________________________
AngularJS 1.x Routers and Custom Directives MCQ solution | TCS Fresco Play
Enables Automatic
The............... service is not able to function properly if the current URL is outside the URL given as the base href.
$location
The directive..................that marks where the router should display a view.
ng outlet
Which function is used to set up a default route?
Otherwise()
With _____, views and routes are tied to the application url
ngRoute
Which function best describes routing?
Loads Template in -ng view element
what is the purpose of the $location service?
enables changing
Is router part of core Angular script file?
No
Which is the correct syntax format for constructing a route and binding a route parameter?
href="#/detail/{{food.id}}"
Complete the code to set up the locale controller to use the local service function
LocaleController(scope,scope,locale) { scope.myDate=Date.Now(); scope.myDate=Date.Now();scope.formattedDate=?.DATETIME_FORMATS.fullDate; }
getDate
For using ui-sref, what is required
State
What is not a characteristics of a UI-Router?
does not allow
Which UI-Router directive allows you to create links connecting to your states?
Ui-sref
____ implements routing based on the state of the application where as ______ implements routing based on the route URL
uirouter, ngroute
Which of the directives allow the animation move?
ngrepeat
Can animations be achieved with custom directive?
Yes
When does ngAnimate checks for animation in the application?
During run time
Every built-in directive in AngularJS support animations.
FALSE
In AngularJS, .............. is an Angular service which traverses the DOM looking for attributes.
Compile
A .......... is a behavior which should be triggered when specific HTML constructs are encountered during the compilation process
Directive
Which feature best describes the template property?
very small templates
which feature best describes the $compile service?
creates new HTML
When creating an AngularJS directive, which character is used with the restrict option to specify that only the attribute name should be matched?
A
which of the following variables can be injected into a function once you have included ui-router in the list of dependencies for your module?
$urlRouterProvider and $stateProvider
Which function can be used to update the HTML?
digest
................Configures a Router with RouteDefinitions, each mapping a URL path to a component.
RouteConfig
Which is not true about directives?
less messy
In UI router, _________ can be used to provide your controller with content or data that is custom to the state
param
States are defined using ________ service
$state
What is not true about an abstract state?
Abstract state cannot have url
ngAnimate module is defined in which library?
angular-animate.js
What is default scope in a angular directive
Parent Scope
What is the difference between controller and link in directives
controller expose API
$animate can be used in a directive
TRUE
Select the AngularJS services required to perform automatic scrolling in an HTML page
$anchorScroll
AngularJS is a mix of
html and java
must be called on a scope when it is desired for the scope and its child scopes to be permanently detached from the parent
$destroy()
what is a feature of the $anchorScroll service?
Enables automatic scrolling in parts of a page
Which function best describes routing?
Loads templates into the ng-view element
The…………… service is not able to function properly if the current URL is outside the URL given as the base href.
$location
With _, views and routes are tied to the application url
ngRoute
what is the purpose of the $location service?
It enables changing the path of the application in order to perform navigation
Which function is used to set up a default route?
otherwise
The directive………………that marks where the router should display a view
ng-outlet
What is not a characteristics of a UI-Router? It does not allow the use of multiple
subviews on a page
Which UI-Router directive allows you to create links connecting to your states?
ui-sref
which of the following variables can be injected into a function once you have included ui-router in the list of dependencies for your module?
$urlRouterProvider AND $stateProvider
___ implements routing based on the state of the application where as ______ implements routing based on the route URL
ui-router, ngroute
For using ui-sref, what is required
The state to be activated
When does ngAnimate checks for animation in the application?
runtime
Every built-in directive in AngularJS support animations.
FALSE
Which of the directives allow the animation move?
ng_repeat
Can animations be achieved with custom directive?
Yes
A ___ is a javaScript factory function that holds a set of instructions for the HTML compiler for defining a specified behavior of a DOM element.
directive
When creating an AngularJS directive, which character is used with the restrict option to specify that only the attribute name should be matched
A
Which feature best describes the template property?
The template property is used for very small templates
which feature best describes the $compile service?
Creates new HTML elements and attributes
A ………. is a behavior which should be triggered when specific HTML constructs are encountered during the compilation process
directive
In AngularJS, ………….. is an Angular service which traverses the DOM looking for
attributes.
compile
In UI router, _ can be used to provide your controller with content or data that is custom to the state
resolve
$stateParams is used to access url parameters of parent state
FALSE
What is not true about an abstract state?
Activated when child get active
Configures a Router with RouteDefinitions, each mapping a URL path to a component
Routeconfig Complete the code to set up the locale controller to use the local service
Locale
Angularjs Application may have
several root scope exactly one child scope
Which filter will be executed one or more times during the each $digest cycle.
Stateful
With _, views and routes are tied to the application url
ng-route
Each view gets an absolute name in the format of
viewname@statename
Select the correct function call allowing the controller to obtain data from myserver.com using AJAX?
http.get
$animate can be used in a directive
TRUE
What is default scope in a angular directive
parent
The params for the currect state be accessed in a controller using
$state
What is the best scope to be used for reusable directives
root scope
Post a Comment