Angular 9

Angular 9

Q.1 What do you mean by Single Page Applications (SPA)?
A single page application is a web application or website that interacts with the user by dynamically rewriting the current web page with new data from the web server, in place of the default method of a web browser loading entire new pages.
Q.2 What are the various features of Angular?

1. Accessibility Applications

2. Angular CLI

3. Animation Support

4. Cross-Platform App Development

5. Code Generation

6. Code Splitting

7. Synergy with Popular Code Editors and IDEs

Q.3 Describe the MVVM architecture?

MVVM architecture removes tight coupling between each component. The MVVM architecture comprises of three parts:

1. Model

2. View

3. ViewModel

Q.4 Explain Model?
It represents the data and the business logic of an application, or we may say it contains the structure of an entity. It consists of the business logic - local and remote data source, model classes, repository.
Q.5 Give the Advantages of AOT compilation?

1. Fast Rendering

2. Fewer Ajax Requests

3. Minimizing Errors

4. Better Security

Q.6 Discuss the advantages of using Angular?

1. Ability to add a custom directive

2. Exceptional community support

3. Facilitates client and server communication

4. Features strong features, such as Animation and Event Handlers

5. Follows the MVC pattern architecture

6. Offers support for static template and Angular template

7. Support for two-way data-binding

8. Supports dependency injection, RESTful services, and validations

Q.7 Discuss the disadvantages of using Angular?

1. Complex SPAs can be inconvenient and laggy to use due to their size

2. Dynamic applications do not always perform well

3. Learning Angular requires a decent effort and time

Q.8 What is Angular architecture pattern?
Angular architecture is defined in main three layers is Core layer, Abstraction layer, and Presentation layer.
Q.9 Who started Angular?
Miško Hevery, is the inventor of angular.
Q.10 What are directives in Angular?

1. Attribute Directives

2. Component Directives

3. Structural Directives

Q.11 What is TypeScript used for?
TypeScript is an open-source language which builds on JavaScript, one of the world's most used tools, by adding static type definitions.
Q.12 What are the advantages of TypeScript?

1. Optional static typing.

2. Early spotted bugs.

3. Predictability.

4. Readability.

5. Rich IDE support.

Q.13 What are the features of TypeScript?

1. TypeScript is just JavaScript.

2. TypeScript supports other JS libraries.

3. JavaScript is TypeScript.

4. TypeScript is portable.

Q.14 What is routing?
Routing is a process which is performed by layer 3 (or network layer) devices in order to deliver the packet by choosing an optimal path from one network to another.
Q.15 What are the types of routing?

There are 3 types of routing:

  • Static routing,
  • Default Routing
  • Dynamic Routing.
Q.16 Explain Static routing?
Static routing is a process in which we have to manually add routes in routing table.
Q.17 List the applications of static routing?

1. No routing overhead for router CPU which means a cheaper router can be used to do routing.

2. It adds security because only administrators can allow routing to particular networks only.

3. No bandwidth usage between routers.

Q.18 Explain Default Routing?
This is the method where the router is configured to send all packets towards a single router. It is generally used with stub routers. A stub router is a router which has only one route to reach all other networks.
Q.19 Explain Dynamic Routing?
Dynamic routing makes automatic adjustment of the routes according to the current state of the route in the routing table. RIP and OSPF are the best examples of dynamic routing protocol.
Q.20 List the advantages of dynamic protocol?

1. Easy to configure.

2. More effective at selecting the best route to a destination remote network and also for discovering remote network.

Q.21 List the disadvantages of dynamic protocol?

1. Consumes more bandwidth for communicating with other neighbors.

2. Less secure than static routing.

Q.22 What are child routes?
A child route is like any other route, in that it needs both a path and a component . The one difference is that you place child routes in a children array within the parent route.
Q.23 What is hierarchical dependency injection?
A hierarchical dependency injection system allows us to define different boundaries or scopes for our dependencies to run in and follows the component tree structure.
Q.24 What are the types of dependency injection?

There are three types of dependency injection:

  • constructor injection,
  • method injection,
  • property injection.
Q.25 What are the different types of Angular directives?

1. Components

2. Attribute directives

3. Structural directives

Q.26 Why do we use NG model?
ngModel is a directive which binds input, select and textarea, and stores the required user value in a variable and we can use that variable whenever we require that value.
Q.27 What are structural directives?
Structural Directives are directives that change the structure of the DOM by adding or removing elements.
Q.28 What are attribute directives?
The attribute directive alters the appearance or behavior of a DOM element. These directives look like regular HTML attributes in templates.
Q.29 What are the pipes in angular?
Pipes are simple functions you can use in template expressions to accept an input value and return a transformed value.
Q.30 How do you write a custom pipe in angular?

1. Create a Pipe Class and decorate it with the decorator.

2. Supply a name property to be used as a template code name.

3. Register your Pipe in the module under-declarations.

4. Finally, implement PipeTransform and write transformation logic.

Q.31 What is the difference between pure and impure pipe in Angular?
A pure pipe is only called when Angular detects a change in the value or the parameters passed to a pipe. Whereas, an impure pipe is called for every change detection cycle no matter whether the value or parameter changes.
Q.32 What are pure pipes in Angular?
Pipes are defined as pure so that Angular executes the pipe only when it detects a pure change to the input value.
Q.33 How to make a custom decorator?

1. To create a class decorator.

2. To create a method decorator.

3. To create a decorator that can be used multiple times on a single method.

4. To create a property decorator.

5. To create a parameter decorator.

6. To create method decorator for parameters.

7. Decorator options.

8. Customize inheritance of metadata.

Q.34 What is the decorator?
Decorators provide a way to add both annotations and a meta-programming syntax for class declarations and members.
Q.35 What is service in Angular?
An Angular service is a stateless object and provides some very useful functions. These functions can be invoked from any component of Angular, like Controllers, Directives, etc.
Q.36 What is descriptor in angular?
Throttle is a property decorator and it means that it's job is usually to modify the class property descriptor.
Q.37 How many decorators can be applied?
Many decorators on the same piece of code as you desire, and they'll be applied in the order that you declare them.
Q.38 Who maintains TypeScript?
TypeScript is a programming language developed and maintained by Microsoft.
Q.39 What is the difference between CanActivate and CanActivateChild?
The CanActivateChild guard works similarly to the CanActivate guard, but the difference is its run before each child route is activated.
Q.40 What are guards in Angular?
Guards in Angular are nothing but the functionality, logic, and code which are executed before the route is loaded or the ones leaving the route.
Q.41 What is AuthGuard?
AuthGuard is a class which implements the interface CanActivate , to decide whether the user has permission to view specific page / route / path in the application or not.
Q.42 How do I setup a scss project?

1. Create a package.

2. Install node-sass.

3. Get node-sass working.

4. Run the sass script.

Q.43 What is the advantage of SCSS over CSS?
SCSS contains all the features of CSS and contains more features that are not present in CSS which makes it a good choice for developers to use it. SCSS is full of advanced features. SCSS offers variables, you can shorten your code by using variables. It is a great advantage over conventional CSS.
Q.44 How do I convert CSS to SCSS?

1. Rename your . css files to . scss. ...

2. Install Sass and Compass locally.

3. Set-up a config. rb file.

Q.45 What is the advantage of SCSS?
Sass facilitates you to write clean, easy and less CSS in a programming construct. It contains fewer codes so you can write CSS quicker. It is more stable, powerful, and elegant because it is an extension of CSS.
Q.46 What is navbar header?
A navbar header/navigation bar can extend or collapse, depending on the screen size.
Q.47 What is the use of NAV tag?
The HTML element represents a section of a page whose purpose is to provide navigation links, either within the current document or to other documents.
Q.48 How do I add a design button?

1. Make buttons look like buttons.

2. Put buttons where users expect to find them.

3. Label buttons with what they do.

4. Properly size your buttons.

5. Mind the order.

6. Avoid using too many buttons.

7. Provide visual or audio feedback on interaction.

Q.49 Which types of buttons are permitted in material guidelines?

1. Text button.

2. Outlined button.

3. Contained button.

4. Toggle button.

Q.50 How many primary buttons should a page have?
Every page has a limit of one primary button, unless Repeating a Primary Action.
Get Govt. Certified Take Test