Angular - Skill Assignment Quiz
Angular is a platform and framework for building single-page client applications using HTML and TypeScript.If you wanted to avail this framework on ezitech you have to go throgh the assignment quiz.Then you will understand angular better whhich is given on our website ezitech learning institute.
Q1. What method is used to wire up a FormControl to a native DOM input element in reactive forms?
- Add the string name given to the FormControl to an attribute named controls on the element to indicate what fields it should include.
- Use the square bracket binding syntax around the value attribute on the DOM element and set that equal to an instance of the FormControl.
- Use the formControlName directive and set the value equal to the string name given to the FormControl.
- Use the string name given to the FormControl as the value for the DOM element id attribute.
Q2. What is the difference between the paramMap and the queryParamMap on the ActivatedRoute class?
- Add the string name given to the FormControl to an attribute named controls on the element to indicate what fields it should include.
- Use the square bracket binding syntax around the value attribute on the DOM element and set that equal to an instance of the FormControl.
- Use the formControlName directive and set the value equal to the string name given to the FormControl.
- Use the string name given to the FormControl as the value for the DOM element id attribute.
Q3. What is the RouterModule.forRoot method used for?
- Registering any providers that you intend to use in routed components.
- Registering route definitions at the root application level.
- Indicating that Angular should cheer on your routes to be successful.
- Declaring that you intend to use routing only at the root level.
Q4. What are the two component decorator metadata properties used to set up CSS styles for a component?
- viewEncapsulation and viewEncapsulationFiles.
- There is only one and it is the property named css.
- css and cssUrl.
- styles and styleUrls.
Q5. What is the purpose of the valueChanges method on a FormControl?
- It is used to configure what values are allowed for the control.
- It is used to change the value of a control to a new value. You would call that method and pass in the new value for the form field. It even supports passing in an array of values that can be set over time.
- It returns a Boolean based on if the value of the control is different from the value with which it was initialized.
- It is an observable that emits every time the value of the control changes, so you can react to new values and make logic decisions at that time.
Q6. What directive is used to link an < a > tag to routing?
- routeTo
- routerLink
- routePath
- appLink
Q7. What are Angular lifecycle hooks?
- loggers for tracking the health of an Angular app
- providers that can be used to track the instances of components
- built-in pipes that can be used in templates for DOM events
- reserved named methods for components and directives that Angular will call during set times in its execution, and can be used to tap into those lifecycle moments
Q8. In order for Angular to process components in an application, where do the component types need to be registered?
- within a script tag in the index.html file
- in an NgModule decorator metadata tag named components
- No registration is needed simply include the component files in an app directory.
- in an NgModule decorator metadata property named declarations
Q9. When a service is provided for root and is also added to the provider's configuration for a lazy-loaded module, what instance of that service does the injector provide to constructors in the lazy-loaded module?
- A new instance of that service is created when the module is lazy loaded.
- Providing a service of the same type at a lazy-loaded module level is not allowed.
- If an instance of the service has not been created at the root level yet. it will create one there and then use it.
- A single instance of that service is always instantiated at root and is the only one ever used, including within lazy modules.
Q10. In reactive forms, what Angular form class type is used on the native DOM element to wire it up?
-
FormArray
-
FormControl
-
FormGroup
-
all of these answers
Q11. How does the emulated view encapsulation mode handle CSS for a component?
- It renders the CSS exactly how you wrote it without any changes.
- It makes use of shadow DOM markup and CSS.
- It creates unique attributes for DOM elements and scopes the CSS selectors you write to those attribute ids.
- It renders all of the CSS rules you write as inline CSS on all of the DOM elements you use them on in the template.
Q12. What is the primary difference between a component and a directive?
- A component uses a selector metadata property and a directive does not.
- A directive can be used for adding custom events to the DOM and a component cannot.
- A component has a template and a directive does not.
- A directive can target only native DOM elements.
Q13. Which Angular CLI command would you run to generate a UsersComponent and add it to the SharedModule (in file shared.module.ts in your application)?
- ng generate component --newModule=shared
- ng generate component users --module=shared
- ng generate component users --shared
- ng generate component --add=shared
Q14. What is the difference between the CanActivate and the CanLoad route guards?
- ng generate component --newModule=shared
- ng generate component users --module=shared
- ng generate component users --shared
- ng generate component --add=shared
Q15. How can you configure the injector to use an existing object for a token instead of having it instantiate a class instance?
- Use the
useValue
provider configuration and set that equal to an existing object or an object literal. - It is not possible. Providers can be configured only with class types.
- Simply add the object instance or literal to the providers array.
- Make use of the
asValue
provider configuration property, setting it to true.
Q16. What method is used to wire up a FormControl to a native DOM input element in reactive forms?
- Use the string name given to the FormControl as the value for the DOM element id attribute.
- Use the formControlName directive and set the value equal to the string name given to the FormControl.
- Add the string name given to the FormControl to an attribute named controls on the element to indicate what fields it should include.
- Use the square bracket binding syntax around the value attribute on the DOM element and set that equal to an instance of the FormControl.
Q17. Which Angular CLI command would you use to run your unit tests in a process that reruns your test suite on file changes?
- ng test --single-run=false
- ng test --watch-files
- ng test --progress
- ng test
READY TO GET STARTED?
Are you ready
Let’s Make Something Amazing Together



Need help? Contact our experts
Tell us about your project




