How to Cache and return Requests?
After a service worker is installed and the user
navigates to a different page or refreshes, the service worker will begin to
receive fetch events.
Got a minute? Check out this, Angular 6 Questions | A Complete Guide Book
The following example looks like this.
self.addEventListener('fetch',
function(event)
{
event.respondWith(
caches.match(event.request)
.then(function(response)
{
//Cache return
response
if
(response) {
return
response;
}
return
fetch(event.request);
})
);
});
What Is Angular Language Service?
The Language Service is a way to find the typing
hints, autocompletion, errors, and navigations inside your templates. It can be
an external HTML file or embedded decorators in a string.
Let’s understand the following points -
1. Autocompletion
- It provides you a language hint for speed up the code of your app.
2. Error checking
- It provides you a warning message on your code mistake.
3. Navigation
- It allows you to hover to see where a component, directives, modules, and
then click or press F12 to go directly to its definition.
Got a minute? Check out this, Angular 6 Questions | A Complete Guide Book