<?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/"
	>

<channel>
	<title>AngularJS Archives - LinuxTuto</title>
	<atom:link href="https://www.linuxtuto.com/tag/angularjs/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.linuxtuto.com/tag/angularjs/</link>
	<description>Linux Sysadmin and DevOps blog</description>
	<lastBuildDate>Mon, 05 Sep 2022 13:31:09 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://www.linuxtuto.com/wp-content/uploads/2022/01/cropped-LT_faveicon-32x32.png</url>
	<title>AngularJS Archives - LinuxTuto</title>
	<link>https://www.linuxtuto.com/tag/angularjs/</link>
	<width>32</width>
	<height>32</height>
</image> 
<site xmlns="com-wordpress:feed-additions:1">201456972</site>	<item>
		<title>How To Install AngularJS on Ubuntu 22.04</title>
		<link>https://www.linuxtuto.com/how-to-install-angularjs-on-ubuntu-22-04/</link>
					<comments>https://www.linuxtuto.com/how-to-install-angularjs-on-ubuntu-22-04/#respond</comments>
		
		<dc:creator><![CDATA[LinuxTuto]]></dc:creator>
		<pubDate>Mon, 05 Sep 2022 13:31:09 +0000</pubDate>
				<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[AngularJS]]></category>
		<guid isPermaLink="false">https://www.linuxtuto.com/?p=657</guid>

					<description><![CDATA[<p>AngularJS is an open-source JavaScript framework developed by Google for building dynamic web applications. Compared to other options such as jQuery, Knockout, Handlebars, or PagerJs,...</p>
<p>The post <a href="https://www.linuxtuto.com/how-to-install-angularjs-on-ubuntu-22-04/">How To Install AngularJS on Ubuntu 22.04</a> appeared first on <a href="https://www.linuxtuto.com">LinuxTuto</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>AngularJS is an open-source JavaScript framework developed by Google for building dynamic web applications. Compared to other options such as jQuery, Knockout, Handlebars, or PagerJs, Angular integrates a complete solution that allows us to abandon the old PHP in our developments with modern technology.</p>
<p>In this tutorial you will learn to install and create AngularJS Application on a Ubuntu 22.04 OS.</p>
<h2><span class="has-inline-color has-vivid-purple-color">Step 1: Update Operating System</span></h2>
<p>Update your <strong>Ubuntu</strong> <strong>22.04</strong> operating system to make sure all existing packages are up to date:</p>
<pre><code>$ sudo apt update &amp;&amp; sudo apt upgrade -y</code></pre>
<h2><span class="has-inline-color has-vivid-purple-color">Step 2: Install Node.js</span></h2>
<p>Currently, Angular is only supported on LTS versions of Node.js</p>
<p>The Node.js version included in the default Ubuntu 22.04 repositories is <code>v12.22.9</code> which is an older LTS version.</p>
<p>We’ll install Node.js version <code>16.x</code> LTS on our Ubuntu OS.</p>
<p>First, add the Node.js repository running the following command:</p>
<pre><code>curl -sL https://deb.nodesource.com/setup_16.x | bash -</code></pre>
<p>Once added, install the Node.js with the following command:</p>
<pre><code>$ sudo apt-get install nodejs</code></pre>
<p>Verify the installed version of Node.js running the following command:</p>
<pre><code>node --version</code></pre>
<p>You should see the following output:</p>
<pre><code>v16.17.0</code></pre>
<p>Run the following command to install <code>npm</code> latest version globally:</p>
<pre><code>$ sudo npm install npm@latest -g</code></pre>
<p><code>npm</code> is the <code>n</code>ode <code>p</code>ackage <code>m</code>anager used to install the Angular command-line interface on a system.</p>
<p>Verify the <code>npm</code> version with the following command:</p>
<pre><code>npm --version</code></pre>
<p>You should get the following output:</p>
<pre><code>8.18.0</code></pre>
<h2><span class="has-inline-color has-vivid-purple-color">Step 3: Install AngularJS on Ubuntu 22.04</span></h2>
<p>After installing node package manager, you can now use it to install AngujarJS. Run the following command to install.</p>
<pre><code>$ sudo npm install -g @angular/cli</code></pre>
<p>Check AngularJS version installed using the command below.</p>
<pre><code>$ sudo ng version</code></pre>
<p>Sample output:</p>
<p><img fetchpriority="high" decoding="async" class="aligncenter wp-image-665" src="https://www.linuxtuto.com/wp-content/uploads/2022/08/angular_cli.jpg" alt="Angular CLI" width="899" height="561" srcset="https://www.linuxtuto.com/wp-content/uploads/2022/08/angular_cli.jpg 799w, https://www.linuxtuto.com/wp-content/uploads/2022/08/angular_cli-300x187.jpg 300w, https://www.linuxtuto.com/wp-content/uploads/2022/08/angular_cli-768x480.jpg 768w, https://www.linuxtuto.com/wp-content/uploads/2022/08/angular_cli-684x427.jpg 684w" sizes="(max-width: 899px) 100vw, 899px" /></p>
<h2><span class="has-inline-color has-vivid-purple-color">Step 4: Create AngularJS Application</span></h2>
<p>Now, you can create a AngularJS application with the following command:</p>
<pre><code>$ sudo ng new angular-demo-app </code></pre>
<p>Sample Output:</p>
<pre><code>? Would you like to add Angular routing? <strong>Yes</strong>
? Which stylesheet format would you like to use? <strong>CSS</strong>
CREATE angular-demo-app/README.md (1068 bytes)
CREATE angular-demo-app/.editorconfig (274 bytes)
CREATE angular-demo-app/.gitignore (548 bytes)
CREATE angular-demo-app/angular.json (2972 bytes)
CREATE angular-demo-app/package.json (1047 bytes)
CREATE angular-demo-app/tsconfig.json (863 bytes)
CREATE angular-demo-app/.browserslistrc (600 bytes)
CREATE angular-demo-app/karma.conf.js (1433 bytes)
CREATE angular-demo-app/tsconfig.app.json (287 bytes)
CREATE angular-demo-app/tsconfig.spec.json (333 bytes)
CREATE angular-demo-app/.vscode/extensions.json (130 bytes)
CREATE angular-demo-app/.vscode/launch.json (474 bytes)
CREATE angular-demo-app/.vscode/tasks.json (938 bytes)
CREATE angular-demo-app/src/favicon.ico (948 bytes)
CREATE angular-demo-app/src/index.html (300 bytes)
CREATE angular-demo-app/src/main.ts (372 bytes)
CREATE angular-demo-app/src/polyfills.ts (2338 bytes)
CREATE angular-demo-app/src/styles.css (80 bytes)
CREATE angular-demo-app/src/test.ts (749 bytes)
CREATE angular-demo-app/src/assets/.gitkeep (0 bytes)
CREATE angular-demo-app/src/environments/environment.prod.ts (51 bytes)
CREATE angular-demo-app/src/environments/environment.ts (658 bytes)
CREATE angular-demo-app/src/app/app-routing.module.ts (245 bytes)
CREATE angular-demo-app/src/app/app.module.ts (393 bytes)
CREATE angular-demo-app/src/app/app.component.css (0 bytes)
CREATE angular-demo-app/src/app/app.component.html (23115 bytes)
CREATE angular-demo-app/src/app/app.component.spec.ts (1103 bytes)
CREATE angular-demo-app/src/app/app.component.ts (220 bytes)
✔ Packages installed successfully.
</code></pre>
<p>After installing, navigate to the installation folder.</p>
<pre><code>$ sudo cd angular-demo-app</code></pre>
<p>Once you are in the project folder you can start Angular application in development mode with the following command:</p>
<pre><code>$ sudo ng serve</code></pre>
<p>By default <code>ng serve</code> start application on localhost on port <code>4200.</code></p>
<p>Alternatively, you can change the host and port on which the application is running using:</p>
<pre><code>$ sudo ng serve --host 0.0.0.0 --port 8000</code></pre>
<p>Here, the application is running on IP address 0.0.0.0 and port 8000.</p>
<p>Open your favorite browser and enter the URL <code>your-IP-address:8000</code> to access your Angular app.</p>
<p><img decoding="async" class="size-large wp-image-679 aligncenter" src="https://www.linuxtuto.com/wp-content/uploads/2022/09/angularjs-1024x576.jpg" alt="AngularJS on Ubuntu" width="1024" height="576" srcset="https://www.linuxtuto.com/wp-content/uploads/2022/09/angularjs-1024x576.jpg 1024w, https://www.linuxtuto.com/wp-content/uploads/2022/09/angularjs-300x169.jpg 300w, https://www.linuxtuto.com/wp-content/uploads/2022/09/angularjs-768x432.jpg 768w, https://www.linuxtuto.com/wp-content/uploads/2022/09/angularjs-1536x864.jpg 1536w, https://www.linuxtuto.com/wp-content/uploads/2022/09/angularjs-1222x687.jpg 1222w, https://www.linuxtuto.com/wp-content/uploads/2022/09/angularjs-897x505.jpg 897w, https://www.linuxtuto.com/wp-content/uploads/2022/09/angularjs-684x385.jpg 684w, https://www.linuxtuto.com/wp-content/uploads/2022/09/angularjs.jpg 1920w" sizes="(max-width: 1024px) 100vw, 1024px" /></p>
<h2><span class="has-inline-color has-vivid-purple-color">Step 5: Run Angular with PM2</span></h2>
<p>In this step we will describe you to how to run Angular app with PM2 command. <code>PM2</code> is a Production Process Manager for Node.js applications.</p>
<p>First, install <code>PM2</code> application by running the following command:</p>
<pre><code>$ sudo npm install -g pm2</code></pre>
<p>You can simply start Angular server to serve your application on 127.0.0.1 (localhost) and port 4200 with the following command:</p>
<pre><code>$ sudo pm2 start "ng serve"</code></pre>
<p>You can specific host, port and name of your app with the following command:</p>
<pre><code>$ sudo pm2 start "ng serve --host 0.0.0.0 --port 8000" --name "Angular Demo App"</code></pre>
<p>Enabling watch is another great feature of <code>PM2</code>. It will restart the application after getting any changes in files. This reduces your pain of restarting application after making changes everytime.</p>
<pre><code>$ sudo pm2 start "ng serve --host 0.0.0.0 --port 8000" --name "Angular Demo App" --watch /angular-demo-app</code></pre>
<p>Once you started your Angular application using <code>PM2</code> run the following command to view the status of your application.</p>
<pre><code>$ sudo pm2 status</code></pre>
<p><img decoding="async" class="aligncenter wp-image-682 size-large" src="https://www.linuxtuto.com/wp-content/uploads/2022/09/angular_demo_app_pm2-1024x63.jpg" alt="Angular PM2" width="1024" height="63" srcset="https://www.linuxtuto.com/wp-content/uploads/2022/09/angular_demo_app_pm2-1024x63.jpg 1024w, https://www.linuxtuto.com/wp-content/uploads/2022/09/angular_demo_app_pm2-300x19.jpg 300w, https://www.linuxtuto.com/wp-content/uploads/2022/09/angular_demo_app_pm2-768x48.jpg 768w, https://www.linuxtuto.com/wp-content/uploads/2022/09/angular_demo_app_pm2-1536x95.jpg 1536w, https://www.linuxtuto.com/wp-content/uploads/2022/09/angular_demo_app_pm2-1222x76.jpg 1222w, https://www.linuxtuto.com/wp-content/uploads/2022/09/angular_demo_app_pm2-897x56.jpg 897w, https://www.linuxtuto.com/wp-content/uploads/2022/09/angular_demo_app_pm2-684x42.jpg 684w, https://www.linuxtuto.com/wp-content/uploads/2022/09/angular_demo_app_pm2.jpg 1761w" sizes="(max-width: 1024px) 100vw, 1024px" /></p>
<p>For any issues, you can run PM2 logs command. This will display application and error log on screen.</p>
<pre><code>$ sudo pm2 logs 0</code></pre>
<h2><span class="has-inline-color has-vivid-purple-color">Conclusion</span></h2>
<p>Congratulations. You have learned how to Install AngularJS and create a sample app on Ubuntu 22.04. Also, you have learned how to deploy AngularJS application using PM2.</p>
<p>In order to get more information on this topic you can visiting the <a href="https://angularjs.org/">official website of AngularJS</a>.</p>
<p>The post <a href="https://www.linuxtuto.com/how-to-install-angularjs-on-ubuntu-22-04/">How To Install AngularJS on Ubuntu 22.04</a> appeared first on <a href="https://www.linuxtuto.com">LinuxTuto</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.linuxtuto.com/how-to-install-angularjs-on-ubuntu-22-04/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">657</post-id>	</item>
	</channel>
</rss>
