Sunteți pe pagina 1din 4

Angular2 is written on top of Angular 1.5.x.

Angular 2 uses ______ Dependency Injection. Hierarchical

Which scripting language can be used to write Angular2 apps? TypeScript or JavaScript

Which is not true about Angular2? Angular2 extensively uses $scope object to implement MV*
pattern

Which of the following is one of the blocks of Angular 2 Architecture? None

The decorator that is used to indicate a module is _____.NgModules

What is it called, when you "compile the applicaton as part of the build process"?Ahead-of-
Time(AOT) Compilation.

What are the types of Angular View Classes that can be associated to a Module?Components,
Directives and Pipes

The @Component decorator defines how an application should be compiled and launched.F

What is it called, when you "compile the application in the browser before launching the app"?
Just-In-Time(JIT) Compilation

Root module class by convention named as AppModule

An app can have one or no modules present.F

Components can be used with attributes and tags

There can be only one component per DOM element.T

Select the correct Component Lifecycle sequence (Note: Not all Lifecycles methods are present).
ngOnChanges() -> ngOnInit() -> ngDoCheck() -> ngAfterContentChecked() -> ngAfterViewInit() ->
ngOnDestroy()

How many lifecycle methods does Angular offer apart from a Component's construtor()?8

A _______ acts as a mediator between application / business logic and the application
presentaion layer.Component

______ are mandatory parameter in components.template

element property is used to tell angular to insert the instance of component in the HTML
file.selectors.
Multiline template should be included within ....

Templates can also be added using URLs of the file containing code.T

Which of the following is the correct usage of template syntax?<li (click)="selectHero(hero)"


*ngFor="let hero of heroes"></li>

What does the following code demonstrate?<input #empId placeholder="Enter your TCS
employee id" required> Use of Template Reference Variables

What happens when the following code is encountered by Angular?

<tr>

<td id="tableData4" colspan={{2 * 2}}>

</td>

</tr>`The <td > A template parse error is thrown since colspan is a native HTML attribute

Consider following code.<p class="bold text-center"> {{data.userName}} </p>The data object is


fetched from a service and turns out to be null. In such a case, how can you ensure that the app
doesn't crash or log any errors<p class="bold text-center"> {{data?.userName}} </p>

Templates handle the view part of the application. T

Which of the following helps you define Metadata for a class?Using Decorator

Which among the following is not a metadata?@template

Which of the following are valid metadata properties?All

Everything in Angular 2 is a simple class, until you declare metadata.T

Which of the following is NOT an Angular metadata Decorator?@Bindable

Which of the following correctly represents one-way data binding, from view to source?<button
(click) ="buttonClicked()">Click Me!</button>

Two way binding is done using _____.[(ngModel)]


Which Angular module helps you achieve two-way data binding?FormsModule

Which of the following correctly represents one-way data binding, from source to view?<my-
component (fresco)="frescoPlay"></my-component>

Data binding helps in synchronizing _____________.template and components

Two way binding is defined using ___________.[()]

In-order to bind data from view to component class you can use event binding

Which of the following correctly represents two-way data binding?<input type="password"


[(ngModel)]="userPwd" required>

Which of the following correctly represents one-way data binding, from source to view <fresco-
quiz [quizId]="frescoId"></fresco-quiz>

Property binding is defined using _________.[]

Which directive lets you change the rendered view by adding and removing elements from the
Document Object Model?Structural

NgFor and NgIf are examples of ...?Structural

ngOnInit will be initilized everytime when the template re-renders.F

What happens to the <div> element once application is launched? <div *ngIf="servePie"> Pie
Chart – Sales Projection ..... </div>If 'servePie' evaluates to false, the element is destroyed from
the DOM

Which among the following is not a Directive?Module

Which of the following is an Attribute Directive?NgModel

Which directive lets you modify the behaviour of another Directive?Attribute

What are some advantages of lazy loading?All

Services are included in components using provider

Services are identified using the decorator @Injectable


There can be only one service in a component.F

How will you make sure that a single instance of any Service is available throughout the app?
Register the service using 'providers' and add it to the Root Module

Which of the following is not true about Services?Services are designed to do a lot of things at
one time

S-ar putea să vă placă și