Lazy loading is most useful concept of angular routing and bring down the size of large file. This is done by Lazy loading the files that is required load occasinally. Angular 8 comes with support dynamic imports in our routing configuration.
Return single value
Not cancellable
More readable code with try/catch and async/await
Work with multiple value over the time
Cancellable
Support map, filter, reduce and similar operators use RxJs (Reactive extension).
Angular Observable use as an interface to handle a variety of common asynchronous operations such as send observable data from child to parent component by defining custom events, handle AJAX or HTTP requests and responses, listen and respond user input in Angular Router and Forms.
The RxJs provides below utility functions for creating and working with Observables.
1. Converting
2. Iterating
3. Maping
4. Filtering
5. Composing
Subscribe() is a method in Angular that connects the observer to observable events. Whenever any change is made in these observable, a code is executed and observes the results or changes using the subscribe method. Subscribe() is a method from the rxjs library, used internally by Angular.
A Wildcard route has a path consisting of two asterisks (). It matches every URL, the router will select this route if it can't match a route earlier in the configuration. A Wildcard Route can navigate to a custom component or can redirect to an existing route. Example: { path: '', component: PageNotFound }
CodeLyzer is an open-source tool in angular whose main function is to check for errors in code which is not following pre-defined guidelines. It runs in tslist.json file and it checks errors only for static code while coading.
Javascript is developed with ES5 standards.
Typescript is developed with ES6 standards.
Typescript is a superset of javascript.
Data binding is a process that creates a connection between the application’s UI and the data. When the data changes its value, the UI elements that are bound to the data will also change.
There mainly two types of data binding in angular
One way data binding is a change in the state affects the view from component to view template or change in the view affects the state from view template to component.
Two-way data binding is a change from the view can also change the model and similarly changes in the model can also change in the view from component to view template, and also from view template to the component.
There are several ways to bind data between components and view in Angular.
1. Interpolation
2. Property binding
3. Class binding
4. Style binding
5. Attribute binding
6. Event binding
7. Two-way binding
The flow of angular works... Main.ts > AppModule.ts > App.component.ts It serves the content available in template files.
In angular index.html is the only file that is served from server, that is the reason angular is called single page application. all the other files served by angular.
The key difference between synchronous and asynchronous communication is synchronous communications are scheduled, real-time interactions by phone, video, or in-person. Asynchronous communication happens on your own time and doesn't need scheduling.
When an async function is called, it returns a Promise. When the async function returns a value, the Promise will be resolved with the returned value. When the async function throws an exception or some value, the Promise will be rejected with the thrown value.
An async function can contain an await expression, that pauses the execution of the async function and waits for the past Promise’s resolution, and then resumes the async function’s execution and returns the resolved value.