1. What is meant by prototype project ?

The Prototyping Model is a systems development method (SDM) in which a prototype (an early approximation of a final system or product) is built, tested, and then reworked as necessary until an acceptable prototype is finally achieved from which the complete system or product can now be developed.

2. What are the advantage of Angular over React JS?

·         Angular bundles many components that a standard app might need, like routing, AJAX requests, forms, XSS protection, etc. On the other hand, React has minimal in-built features. This allows you to build those libraries yourself, tailored to your exact requirements. Or you can choose from a wide range of libraries developed especially to be work with React.

·         When we are discussing Angular vs React in terms of language expertise, Angular uses TypeScript, which was released in 2012. Thus, it is a relatively new language and has a small number of people using it. React uses JavaScript which was released in 1995.

·         Angular is highly scalable due to its robust design and powerful command-line interface. But React claims to be easier to test, which would make scaling easier too.

·         Considering the components between Angular vs React, Angular has, it takes time to load, especially on mobiles. In comparison, React was always sleek, and hence loaded faster.

3. When we go for Angular and when we go for React Native?

Choose Angular web development if,

·         Your app’s complexity level will be between low and medium.

·         Your team is well-versed with previous Angular versions, C# and, Java.

·         You want to build a scalable and feature-rich application from the ground up.

Choose React web development if,

·         You plan to add more features to your app in the future.

·         Your team is well-versed with HTML, CSS, and JavaScript.

·         You expect a large number of components to be reused across applications.

Of course, this is not an exhaustive list by any means. There are a great many nuances to selecting the right frontend technology for your app, project, or business that might not always conform to these broad outlines.

But the fact remains that you can’t go wrong by choosing either Angular or React. The latter has matured to a great degree while the former is progressively getting better with each new version release.

4. How is single page application technology different from the traditional web technology?

Traditional web application:

       We can see that the client on receiving the request from user sends the request to the server and then the server reciprocates in the form of HTML code which in turn the browser renders on the screen. We can see the biggest problem here is that we give a lot of requests to the server. We probably have to query the server to get back new data to the user.

With this approach, we spend a lot of time sending requests and getting responses because data has to travel through the internet and this, in turn, will lead to a slow feeling of web pages.

Single Page Application:

         In a single page application, user click on the link and the request is handled by the client itself but there is some initial interaction between client and server.In the SPA(Single Page Application), we can save many requests because we don’t need to load the service operations again and again.

5. What are the difference between Angular JS and Angular?

Architecture:

Angular JS: Supports Model-View-Controller design. The view processes the information available in the model to generate the output.

Angular: Uses components and directives. Components are the directives with a template.

Written:

Angular JS: Written in JavaScript.

Angular: Written in Microsoft’s TypeScript language, which is a superset of ECMAScript 6 (ES6).

Mobile support:

Angular JS: Does not supported by mobile browsers.

Angular: But Angular supported by all the popular mobile browsers.

Expression Syntax:

Angular JS:Particular syntax is used to bind data from view to model and vice versa.

Angular: Properties enclosed in “()” and “[]” are used to bind data b/w view and model.

Dependency Injection:

Angular JS: Does not use Dependency Injection.

Angular: Hierarchical Dependency Injection system used.

Routing:

Angular JS: AngularJS uses $routeprovider.when() for routing configuration.

Angular: Angular uses @Route Config{(…)} for routing configuration. 

Structure:

Angular JS: It is less manageable in comparison to Angular.

Angular: Better structure compare to AngularJS, easier to create and maintain large applications but behind in AngularJS in case of small applications.

6.What is String Interpolation?

String interpolation is a one-way data-binding technique which is used to output the data from a typescript code to HTML template. It uses the template expression. It uses the template expression in double curly braces {{ }} to display the data from component to view.

7.What is difference between annotation and decorator in Angular?

In Angular, annotations are used for creating an annotation array. They are only metadata set of the class using the Reflect Metadata library.

Decorators in Angular are design patterns used for separating decoration or modification of some class without changing the original source code.

8.Which type of databinding used in Angular framework?

Data-binding in AngularJS apps is the automatic synchronization of data between the model and view components. It allows us to define communication between the component and view. So we can say that data binding is passed from component to view and from view to the component.

·         String Interpolation.

·         Property Binding.

·         Event Binding.

·         Two-Way Data Binding.

9.What is devDependencies in Angular CLI?

Dependencies you only need during development or releasing, like compilers that take your code and compile it into javascript, test frameworks or documentation generators.

10.What is difference between Angular and NodeJS as both are the frameworks of Javascript?

Node.js is a cross-platform runtime library and environment for running JavaScript applications outside the browser. This is a free and open source tool used for creating server-side JS applications. Node.js applications are written in JavaScript. This application can runs within the Node.js runtime on Linux and Microsoft Windows. This framework offers a rich library of various JavaScript modules to simplify web development process.

Angular is a structural framework for developing dynamic web apps. It allows developers to use HTML as template language and lets HTML's syntax to express application's components briefly but clearly. It is a full-featured JavaScript framework, with the primary goal of simplification. It provides support for developing dynamic, single page web apps and supports the (MVC) programming structure

11. What is the difference between constructor and ngOnInit?

TypeScript classes has a default method called constructor which is normally used for the initialization purpose. Whereas ngOnInit method is specific to Angular, especially used to define Angular bindings. Even though constructor getting called first, it is preferred to move all of your Angular bindings to ngOnInit method.

12. What is dependency injection in Angular?

Dependency injection (DI), is an important application design pattern in which a class asks for dependencies from external sources rather than creating them itself. Angular comes with its own dependency injection framework for resolving dependencies( services or objects that a class needs to perform its function).So you can have your services depend on other services throughout your application.

13. What is the difference between pure and impure pipe?

A pure pipe is only called when Angular detects a change in the value or the parameters passed to a pipe. For example, any changes to a primitive input value (String, Number, Boolean, Symbol) or a changed object reference (Date, Array, Function, Object). An impure pipe is called for every change detection cycle no matter whether the value or parameters changes. i.e, An impure pipe is called often, as often as every keystroke or mouse-move.

14. What is a bootstrapping module?

Every application has at least one Angular module, the root module that you bootstrap to launch the application is called as bootstrapping module. It is commonly known as AppModule. 

15. What is an observable?

An Observable is a unique Object similar to a Promise that can help manage async code. Observables are not part of the JavaScript language so we need to rely on a popular Observable library called RxJS. The observables are created using new keyword.

import { Observable } from 'rxjs';

const observable = new Observable(observer => {

  setTimeout(() => {

    observer.next('Hello from a Observable!');

  }, 2000);

});

16. What are lifecycle hooks available?

Angular application goes through an entire set of processes or has a lifecycle right from its initiation to the end of the application. The representation of lifecycle in pictorial representation as follows,The description of each lifecycle method is as below,

  1. ngOnChanges: When the value of a data bound property changes, then this method is called.
  2. ngOnInit: This is called whenever the initialization of the directive/component after Angular first displays the data-bound properties happens.
  3. ngDoCheck: This is for the detection and to act on changes that Angular can't or won't detect on its own.
  4. ngAfterContentInit: This is called in response after Angular projects external content into the component's view.
  5. ngAfterContentChecked: This is called in response after Angular checks the content projected into the component.
  6. ngAfterViewInit: This is called in response after Angular initializes the component's views and child views.
  7. ngAfterViewChecked: This is called in response after Angular checks the component's views and child views.
  8. ngOnDestroy: This is the cleanup phase just before Angular destroys the directive/component.

17. What are the various kinds of directives?

There are mainly three kinds of directives,

  1. Components — These are directives with a template.
  2. Structural directives — These directives change the DOM layout by adding and removing DOM elements.
  3. Attribute directives — These directives change the appearance or behavior of an element, component, or another directive.

18. What is AOT?

Ahead-of-Time (AOT) is a type of compilation that compiles your app at build time. For AOT compilation, include the --aot option with the ng build or ng serve command as below,

ng build --aot

ng serve –aot

19. What are the class decorators in Angular?

A class decorator is a decorator that appears immediately before a class definition, which declares the class to be of the given type, and provides metadata suitable to the type. The following list of decorators comes under class decorators,

  1. @Component()
  2. @Directive()
  3. @Pipe()
  4. @Injectable()
  5. @NgModule()

20. What is lazy loading?

Lazy loading is one of the most useful concepts of Angular Routing. It helps us to download the web pages in chunks instead of downloading everything in a big bundle. It is used for lazy loading by asynchronously loading the feature module for routing whenever required using the property loadChildren.

 

 


Last modified: Friday, 5 June 2020, 3:29 PM