<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	 xmlns:media="http://search.yahoo.com/mrss/" >

<channel>
	<title>Angular &#8211; Nearshore Software Development Company &#8211; IT Outsourcing Services</title>
	<atom:link href="https://nearshore-it.eu/tag/angular/feed/" rel="self" type="application/rss+xml" />
	<link>https://nearshore-it.eu</link>
	<description>We are Nearshore Software Development Company with 14years of experience in delivering a large scale IT projects in the areas of PHP, JAVA, .NET, BI and MDM.</description>
	<lastBuildDate>Wed, 21 Aug 2024 13:59:25 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.8.3</generator>

<image>
	<url>https://nearshore-it.eu/wp-content/uploads/2023/01/cropped-inetum-favicon-300x300-1-32x32.png</url>
	<title>Angular &#8211; Nearshore Software Development Company &#8211; IT Outsourcing Services</title>
	<link>https://nearshore-it.eu</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Angular – Let’s create our own Progressive Web Application</title>
		<link>https://nearshore-it.eu/technologies/angular-pwa/</link>
					<comments>https://nearshore-it.eu/technologies/angular-pwa/#respond</comments>
		
		<dc:creator><![CDATA[Michal Wojcik]]></dc:creator>
		<pubDate>Thu, 18 May 2023 12:01:00 +0000</pubDate>
				<category><![CDATA[Technologies]]></category>
		<category><![CDATA[Articles]]></category>
		<category><![CDATA[Angular]]></category>
		<guid isPermaLink="false">https://nearshore-it.eu/?p=24436</guid>

					<description><![CDATA[In this article, I will show you how to create, configure and test out your own PWA by yourself – step by step – with the help of Angular.]]></description>
										<content:encoded><![CDATA[
<div class="table-of-contents">
    <p class="title">Go to:</p>
    <ol>
                    <li><a href="#What-is-a-PWA?">1.  What is PWA</a></li>
                    <li><a href="#PWA-–-Is-it-worth-it?">2.  PWA – Is it worth it?</a></li>
                    <li><a href="#PWA-–-Tools-for-the-developer">3.  PWA – Tools for the developer</a></li>
                    <li><a href="#Angular:-PWA">4.  Angular: PWA</a></li>
                    <li><a href="#How-to-check-PWA-operation?">5.  How to check PWA operation?</a></li>
                    <li><a href="#So-we-have-a-PWA-–-What’s-next?">6.  So we have a PWA – What’s next?</a></li>
                    <li><a href="#Summary">7.  Summary</a></li>
            </ol>
</div>


<p>As the <a href="https://nearshore-it.eu/articles/technologies/top-e-commerce-trends-for-2021/">e-commerce</a> market develops, the role and popularity of<a href="https://nearshore-it.eu/articles/technologies/pwa-the-front-end-revolution/" data-type="post" data-id="7501"> Progressive Web Applications</a> is growing. The use of this technology makes it possible to create <strong>a fast-loading website that is easy on the eye.</strong> Additionally, you can also count on appreciation from Google’s indexing bots – in accordance with the “mobile first and offline first” policy.<br><br>A <strong>PWA (Progressive Web Application) </strong>is actually a website that, by configuring the service worker and the <strong>manifest.json file,</strong> provides us as developers with the possibilities we can use to create a more attractive website for the end user. PWA technology allows you to create an application that combines the advantages of a website and an app on your phone. In this short article, I will try to describe <strong>PWA configuration using Angular,</strong> which is very simple thanks to the native support in Angular CLI. However, the service worker configuration itself does not really restrict us to some JavaScript framework, like React or Angular. To start the configuration, you actually just need a web page with JavaScript.</p>



<h2 class="wp-block-heading" id="PWA-–-Is-it-worth-it?">PWA – Is it worth it?</h2>



<p>More than half of Internet users in Poland browse websites using mobile devices, and having a responsive, fast-loading website defines the haves and have-nots in e-commerce nowadays. The use of Progressive Web Application technology makes Google’s indexing bots more favorably disposed toward such a site, and it also translates into tangible results – in some cases PWA managed to<strong> increase the conversion rate by 75% </strong>or <strong>reduce the rejection rate by about 40%.</strong></p>



<h2 class="wp-block-heading" id="PWA-–-Tools-for-the-developer">PWA – Tools for the developer</h2>



<p>There are numerous sites, such as <a href="https://whatwebcando.today/" target="_blank" rel="noopener">https://whatwebcando.today/</a>, that provide support for developers. You can easily access the components through JavaScript and service workers. It is worth mentioning at this point that only Google Chrome on Android offers full component support. Unfortunately, Safari on iPhone will restrict us in some areas. Component support is changing so dynamically that it is not worth addressing the differences between browsers. In the first part of the article, I will try to explain how to fully configure and test out our application. In the next part, I will focus on other components such as offline mode, notifications, geolocation and file access. </p>



<p>Are you ready for the PWA adventure? Let’s get started!</p>



<h2 class="wp-block-heading" id="Angular:-PWA">Angular: PWA</h2>



<p>We start by installing the Angular application via Angular CLI. Then we use the following command: <strong>ng add @angular/pwa</strong></p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img fetchpriority="high" decoding="async" width="594" height="352" src="https://nearshore-it.eu/wp-content/uploads/2023/07/nearshore_2023.07.31_graphic_1.jpg" alt="Angular PWA" class="wp-image-24448" title="Angular – Let’s create our own Progressive Web Application 1" srcset="https://nearshore-it.eu/wp-content/uploads/2023/07/nearshore_2023.07.31_graphic_1.jpg 594w, https://nearshore-it.eu/wp-content/uploads/2023/07/nearshore_2023.07.31_graphic_1-300x178.jpg 300w, https://nearshore-it.eu/wp-content/uploads/2023/07/nearshore_2023.07.31_graphic_1-495x293.jpg 495w" sizes="(max-width: 594px) 100vw, 594px" /></figure></div>


<p>This adds a few files required to run PWA to our folder:</p>



<p><strong>ngsw-config.json</strong> – a configuration file that allows you to set up data caching rules. More information about caching strategies can be found here: <a href="https://serviceworke.rs/caching-strategies.html" target="_blank" rel="noopener">https://serviceworke.rs/caching-strategies.html</a></p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img decoding="async" width="603" height="587" src="https://nearshore-it.eu/wp-content/uploads/2023/07/nearshore_2023.07.31_graphic_2.jpg" alt="Angular PWA" class="wp-image-24450" title="Angular – Let’s create our own Progressive Web Application 2" srcset="https://nearshore-it.eu/wp-content/uploads/2023/07/nearshore_2023.07.31_graphic_2.jpg 603w, https://nearshore-it.eu/wp-content/uploads/2023/07/nearshore_2023.07.31_graphic_2-300x292.jpg 300w, https://nearshore-it.eu/wp-content/uploads/2023/07/nearshore_2023.07.31_graphic_2-406x395.jpg 406w" sizes="(max-width: 603px) 100vw, 603px" /></figure></div>


<p><em>We will focus on the configuration of this file in the next part of the article.</em></p>



<p><strong>manifest.webmanifest</strong> – a configuration file that allows you to set the behavior of our application after being saved by the user (orientation, colors, icons).</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img decoding="async" width="601" height="1054" src="https://nearshore-it.eu/wp-content/uploads/2023/07/nearshore_2023.07.31_graphic_3.jpg" alt="Angular PWA" class="wp-image-24452" title="Angular – Let’s create our own Progressive Web Application 3" srcset="https://nearshore-it.eu/wp-content/uploads/2023/07/nearshore_2023.07.31_graphic_3.jpg 601w, https://nearshore-it.eu/wp-content/uploads/2023/07/nearshore_2023.07.31_graphic_3-171x300.jpg 171w, https://nearshore-it.eu/wp-content/uploads/2023/07/nearshore_2023.07.31_graphic_3-225x395.jpg 225w" sizes="(max-width: 601px) 100vw, 601px" /></figure></div>


<p><strong>*.png</strong> – default icons that will be displayed to the user after saving the application on the screen desktop.</p>



<p>Additionally, the following files will be updated:</p>



<p><strong>angular.json</strong> (the set ServiceWorker flag: true),</p>



<p><strong>index.html</strong> – an added line to load the manifest,</p>



<p><strong>app.module.ts</strong></p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="574" height="57" src="https://nearshore-it.eu/wp-content/uploads/2023/07/nearshore_2023.07.31_graphic_4.jpg" alt="Angular PWA" class="wp-image-24454" title="Angular – Let’s create our own Progressive Web Application 4" srcset="https://nearshore-it.eu/wp-content/uploads/2023/07/nearshore_2023.07.31_graphic_4.jpg 574w, https://nearshore-it.eu/wp-content/uploads/2023/07/nearshore_2023.07.31_graphic_4-300x30.jpg 300w, https://nearshore-it.eu/wp-content/uploads/2023/07/nearshore_2023.07.31_graphic_4-495x49.jpg 495w" sizes="auto, (max-width: 574px) 100vw, 574px" /></figure></div>


<p>Thanks to this, our application knows that when we run it in development mode, the service worker should be registered to our browser.</p>


</style><div class="promotion-box promotion-box--image-left "><div class="tiles latest-news-once"><div class="tile"><div class="tile-image"><img decoding="async" src="https://nearshore-it.eu/wp-content/uploads/2024/06/BigCTA_MarekCzachorowski.jpg" alt="BigCTA MarekCzachorowski" title="Angular – Let’s create our own Progressive Web Application 5"></div><div class="tile-content"><p class="entry-title client-name promotion-box__headline2">Elevate Your Application Development</p>
<p class="promotion-box__description2">Our tailored Application Development services meet your unique business needs. Consult with <strong>Marek Czachorowski</strong>, Head of Data and AI Solutions, for expert guidance.</p>
<a class="btn btn-primary booking" href="https://outlook.office365.com/book/BookameetingwithMarek@gfi.fr/" target="_blank" rel="noopener">Schedule a meeting</a></div></div></div></div>



<h2 class="wp-block-heading" id="How-to-check-PWA-operation?">How to check PWA operation?</h2>



<p>Unfortunately, the mere launch of the application through Angular CLI will not allow us to check if the service worker is operating properly. However, we can easily find a workaround for this by running the application we built locally. This can easily be done in two steps.</p>



<ul class="wp-block-list">
<li>We build the application in the development mode: <strong>ng build –prod</strong></li>



<li>We run the http-server (if we do not have a locally installed one, the first thing we need to do is the following: <strong>npm i http-server -g</strong>) and then the following command: <strong>http-server ./dist/pwa-test -o</strong></li>
</ul>



<p>Please remember that after <strong>dist</strong> you have to enter your application name. After entering the command, our website should launch. To check if the service worker and the manifest work properly, we will use Google Chrome’s built-in tools. After launching Developers Tools, we go to the <strong>Application</strong> tab.</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="594" height="337" src="https://nearshore-it.eu/wp-content/uploads/2023/07/nearshore_2023.07.31_graphic_5.jpg" alt="Angular PWA" class="wp-image-24456" title="Angular – Let’s create our own Progressive Web Application 6" srcset="https://nearshore-it.eu/wp-content/uploads/2023/07/nearshore_2023.07.31_graphic_5.jpg 594w, https://nearshore-it.eu/wp-content/uploads/2023/07/nearshore_2023.07.31_graphic_5-300x170.jpg 300w, https://nearshore-it.eu/wp-content/uploads/2023/07/nearshore_2023.07.31_graphic_5-495x281.jpg 495w" sizes="auto, (max-width: 594px) 100vw, 594px" /></figure></div>


<p>In the <strong>Service Worker</strong> side menu, we should see information that our service worker has been found and is properly installed.</p>



<p>In the <strong>Manifest</strong> tab, we will find information about whether the default configuration (colors, icons and name) has been imported correctly.</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="594" height="336" src="https://nearshore-it.eu/wp-content/uploads/2023/07/nearshore_2023.07.31_graphic_6.jpg" alt="Angular PWA" class="wp-image-24458" title="Angular – Let’s create our own Progressive Web Application 7" srcset="https://nearshore-it.eu/wp-content/uploads/2023/07/nearshore_2023.07.31_graphic_6.jpg 594w, https://nearshore-it.eu/wp-content/uploads/2023/07/nearshore_2023.07.31_graphic_6-300x170.jpg 300w, https://nearshore-it.eu/wp-content/uploads/2023/07/nearshore_2023.07.31_graphic_6-495x280.jpg 495w" sizes="auto, (max-width: 594px) 100vw, 594px" /></figure></div>


<p>All this data is read from files that were generated by Angular CLI after the application had been built. They are located in the <strong>/dist/ApplicationName</strong> folder.</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="308" height="340" src="https://nearshore-it.eu/wp-content/uploads/2023/07/nearshore_2023.07.31_graphic_7.jpg" alt="Angular PWA " class="wp-image-24460" title="Angular – Let’s create our own Progressive Web Application 8" srcset="https://nearshore-it.eu/wp-content/uploads/2023/07/nearshore_2023.07.31_graphic_7.jpg 308w, https://nearshore-it.eu/wp-content/uploads/2023/07/nearshore_2023.07.31_graphic_7-272x300.jpg 272w" sizes="auto, (max-width: 308px) 100vw, 308px" /></figure></div>


<p>Thanks to the positive upload of the manifest and the Service Worker, our application allows users to fully use the components on their mobile devices or computers.</p>



<h2 class="wp-block-heading" id="So-we-have-a-PWA-–-What’s-next?">So we have a PWA – What’s next?</h2>



<p>Thanks to the default configuration, we can only save our application on a phone or computer. To do this, just click on the small “plus” icon next to the website address on your computer.</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="878" height="97" src="https://nearshore-it.eu/wp-content/uploads/2023/07/nearshore_2023.07.31_graphic_8.jpg" alt="Angular PWA" class="wp-image-24462" title="Angular – Let’s create our own Progressive Web Application 9" srcset="https://nearshore-it.eu/wp-content/uploads/2023/07/nearshore_2023.07.31_graphic_8.jpg 878w, https://nearshore-it.eu/wp-content/uploads/2023/07/nearshore_2023.07.31_graphic_8-300x33.jpg 300w, https://nearshore-it.eu/wp-content/uploads/2023/07/nearshore_2023.07.31_graphic_8-768x85.jpg 768w, https://nearshore-it.eu/wp-content/uploads/2023/07/nearshore_2023.07.31_graphic_8-495x55.jpg 495w" sizes="auto, (max-width: 878px) 100vw, 878px" /></figure></div>


<p>The name and icon are uploaded from the <strong>manifest</strong> file.</p>



<p>After saving, our website will behave like an application and the user is not aware that they are launching the website in their browser. Once the application is launched (after saving), we should see a window which looks like this:</p>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="572" height="336" src="https://nearshore-it.eu/wp-content/uploads/2023/07/nearshore_2023.07.31_graphic_9.jpg" alt="Angular PWA" class="wp-image-24464" title="Angular – Let’s create our own Progressive Web Application 10" srcset="https://nearshore-it.eu/wp-content/uploads/2023/07/nearshore_2023.07.31_graphic_9.jpg 572w, https://nearshore-it.eu/wp-content/uploads/2023/07/nearshore_2023.07.31_graphic_9-300x176.jpg 300w, https://nearshore-it.eu/wp-content/uploads/2023/07/nearshore_2023.07.31_graphic_9-495x291.jpg 495w" sizes="auto, (max-width: 572px) 100vw, 572px" /></figure></div>


<p><em>As you can see in the picture, the whole top bar with the address, add-ons and bookmarks has disappeared. The user is not aware that the application has launched in their browser.</em></p>



<p>We managed to configure a startup application in Angular, so that it behaves just like a Progressive Web Application. A user who uses our website can only save it for now. In the next steps, we can add some code to our application to inform the user about new versions of our website or to enable its use offline. In future articles, I will expound on the topic of PWA by writing about how to add new features to our newly developed application.</p>



</style><div class="promotion-box promotion-box--image-left "><div class="tiles latest-news-once"><div class="tile"><div class="tile-image"><img decoding="async" src="https://nearshore-it.eu/wp-content/uploads/2023/03/nearshore_2023.02.16_cover.jpg" alt="nearshore 2023.02.16 cover" title="Angular – Let’s create our own Progressive Web Application 11"></div><div class="tile-content"><p class="entry-title client-name">Expert knowledge</p>
Is MongoDB the perfect database system for e-commerce??

<a class="btn btn-primary" href="https://nearshore-it.eu/articles/mongodb-ecommerce-database///" target="_blank" rel="noopener">Read the text!</a></div></div></div></div>



<h2 class="wp-block-heading" id="Summary">Summary</h2>



<p>Creating and configuring a PWA is not difficult. There has been a growing number of online articles concerning the capabilities of the technology that has already been nicknamed “the frontend revolution”. No wonder – a Progressive Web Application allows you to easily create a friendly and fast-loading website. For developers, this is a signal that, by using PWA technology, they can implement a solution that will bring tangible and measurable.</p>


</style><div class="promotion-box promotion-box--image-left promotion-box--full-width-without-image"><div class="tiles latest-news-once"><div class="tile"><div class="tile-content"><p class="promotion-box__description2"><strong>Consult your project directly with a specialist</strong></p>
<a class="btn btn-primary booking" href="https://outlook.office365.com/book/BookameetingwithMarek@gfi.fr/" target="_blank" rel="noopener">Book a meeting</a></div></div></div></div>
]]></content:encoded>
					
					<wfw:commentRss>https://nearshore-it.eu/technologies/angular-pwa/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
