Show List

Quiz - Angular - 2

75%

Public Average Score
Select the right answer for below questions:

What is the syntax for declaring a component in Angular?
component MyComponent
class MyComponent
@Component MyComponent
@component MyComponent
@Component MyComponent

What is an injectable in Angular?
A class that can be injected into another class
A component that can be injected into another component
A service that can be injected into another service
A directive that can be injected into another directive
A class that can be injected into another class

What is the purpose of the @Input decorator in Angular?
To receive data from a parent component
To send data to a child component
To define a data binding in the component
To define a custom directive
To receive data from a parent component

What is the purpose of the @Output decorator in Angular?
To receive data from a parent component
To send data to a parent component
To define a data binding in the component
To define a custom directive
To send data to a parent component

What is the syntax for declaring a service in Angular?
service MyService
class MyService
@Service MyService
@Injectable MyService
@Injectable MyService

What is the difference between a component and a directive in Angular?
A component defines a view in Angular and a directive adds behavior to an element in the view
A component adds behavior to an element in the view and a directive defines a view in Angular
A component is a custom HTML element and a directive is a custom HTML attribute
A component is a custom HTML class and a directive is a custom HTML tag
A component defines a view in Angular and a directive adds behavior to an element in the view

What is the syntax for declaring a pipe in Angular?
pipe MyPipe
class MyPipe
@Pipe MyPipe
@pipe MyPipe
@Pipe MyPipe

What is the purpose of the RouterLink directive in Angular?
To handle navigation in an Angular application
To manage the routing of an Angular application
To define and organize the components in an Angular application
To manage the data flow in an Angular application
To handle navigation in an Angular application

What is the syntax for declaring a module in Angular?
module MyModule
class MyModule
@Module MyModule
@NgModule MyModule
@NgModule MyModule

What is the purpose of the @NgModule decorator in Angular?
To define a module in Angular
To manage the routing of an Angular application
To define and organize the components in an Angular application
To manage the data flow in an Angular application
To define and organize the components in an Angular application

Submit
Retry
{"qz1-173661":"@Component MyComponent","qz1-173662":"A class that can be injected into another class","qz1-173663":"To receive data from a parent component","qz1-173664":"To send data to a parent component","qz1-173665":"@Injectable MyService","qz1-173666":"A component defines a view in Angular and a directive adds behavior to an element in the view","qz1-173667":"@Pipe MyPipe","qz1-173668":"To handle navigation in an Angular application","qz1-173669":"@NgModule MyModule","qz1-173670":"To define and organize the components in an Angular application"}

    Leave a Comment


  • captcha text