<?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>what is single page application - Wikitechy</title>
	<atom:link href="https://www.wikitechy.com/interview-questions/tag/what-is-single-page-application/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.wikitechy.com/interview-questions/tag/what-is-single-page-application/</link>
	<description>Interview Questions</description>
	<lastBuildDate>Wed, 15 Sep 2021 06:26:41 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9</generator>

<image>
	<url>https://www.wikitechy.com/interview-questions/wp-content/uploads/2025/10/cropped-wikitechy-icon-32x32.png</url>
	<title>what is single page application - Wikitechy</title>
	<link>https://www.wikitechy.com/interview-questions/tag/what-is-single-page-application/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>What is SPA in AngularJS ? &#8211; AngularJS programing questions and answers</title>
		<link>https://www.wikitechy.com/interview-questions/angularjs/what-is-spa-in-angularjs/</link>
					<comments>https://www.wikitechy.com/interview-questions/angularjs/what-is-spa-in-angularjs/#respond</comments>
		
		<dc:creator><![CDATA[Editor]]></dc:creator>
		<pubDate>Sat, 10 Jul 2021 19:31:44 +0000</pubDate>
				<category><![CDATA[Angularjs]]></category>
		<category><![CDATA[advanced angularjs interview questions]]></category>
		<category><![CDATA[angularjs 2 interview questions and answers for experienced]]></category>
		<category><![CDATA[angularjs coding interview questions]]></category>
		<category><![CDATA[angularjs coding test]]></category>
		<category><![CDATA[angularjs interview questions codeproject]]></category>
		<category><![CDATA[angularjs spa architecture]]></category>
		<category><![CDATA[angularjs spa authentication]]></category>
		<category><![CDATA[angularjs spa example]]></category>
		<category><![CDATA[angularjs spa framework]]></category>
		<category><![CDATA[angularjs tricky interview questions]]></category>
		<category><![CDATA[building a spa framework using angularjs]]></category>
		<category><![CDATA[building spa with angularjs]]></category>
		<category><![CDATA[single page application angularjs mvc]]></category>
		<category><![CDATA[single page application angularjs template]]></category>
		<category><![CDATA[single page application using angularjs and web api]]></category>
		<category><![CDATA[spa application angularjs]]></category>
		<category><![CDATA[spa in angularjs]]></category>
		<category><![CDATA[spa using angularjs]]></category>
		<category><![CDATA[spa using angularjs example]]></category>
		<category><![CDATA[spa with angularjs tutorial]]></category>
		<category><![CDATA[what is meant by single page application in angularjs]]></category>
		<category><![CDATA[what is single page application]]></category>
		<category><![CDATA[what is spa in angularjs]]></category>
		<category><![CDATA[why angularjs is called single page application]]></category>
		<guid isPermaLink="false">https://www.wikitechy.com/interview-questions/?p=91</guid>

					<description><![CDATA[Answer : Single page application (SPA) is a web application that fits on a single page...]]></description>
										<content:encoded><![CDATA[<div class="TextHeading">
<div class="hddn">
<h2 id="spa-in-angularjs" class="color-green" style="text-align: justify;">SPA in AngularJS</h2>
</div>
</div>
<div class="Content" style="text-align: justify;">
<div class="hddn">
<ul>
<li>Single page application (SPA) is a web application that fits on a single page. All your code (JS, HTML, CSS) is retrieved with a single page load. And navigation between pages performed without refreshing the whole page.</li>
</ul>
</div>
</div>
<div class="ImageContent" style="text-align: justify;">
<div class="hddn"></div>
</div>
<div class="text-center row" style="text-align: justify;">
<div class="col-sm-12">
<div id="bsa-zone_1590522538159-8_123456"><img fetchpriority="high" decoding="async" class="alignnone size-medium aligncenter" src="https://cdn.wikitechy.com/interview-questions/angularjs/spa.png" width="399" height="381" /></div>
</div>
</div>
<div class="TextHeading" style="text-align: justify;">
<div class="hddn">
<h2 id="advantages-of-spa" class="color-green">Advantages of SPA :</h2>
</div>
</div>
<div class="Content" style="text-align: justify;">
<div class="hddn">
<ul>
<li>No page flicker. Native application feel.</li>
<li>Client side routing and data rendering on client side.</li>
<li>Data is from server is in JSON format.</li>
</ul>
</div>
</div>
<div class="TextHeading" style="text-align: justify;">
<div class="hddn">
<h2 id="disadvantages-of-spa" class="color-green">Disadvantages of SPA :</h2>
</div>
</div>
<div class="Content" style="text-align: justify;">
<div class="hddn">
<ul>
<li>User must enable JavaScript.</li>
<li>Security.</li>
</ul>
</div>
</div>
<p style="text-align: justify;">You need to write javascript, handle shared state between pages, manage permissions, etc.</p>
<p style="text-align: justify;">The SPA works on the two Elements:</p>
<div class="Content" style="text-align: justify;">
<div class="hddn">
<ul>
<li style="list-style-type: none;">
<ul>
<li>Ng-Route</li>
<li>Ng-view</li>
</ul>
</li>
</ul>
</div>
</div>
<div class="TextHeading" style="text-align: justify;">
<div class="hddn">
<h2 id="ngroute" class="color-green">ngRoute</h2>
</div>
</div>
<div class="Content" style="text-align: justify;">
<div class="hddn">
<ul>
<li>Since we are making a single page application and we don’t want any page refreshes, we’ll use Angular’s routing capabilities.</li>
<li>The ngRoute module provides routing, deeplinking services and directives for angular apps.</li>
<li>We need to include angular-route script after the main angular script.</li>
</ul>
</div>
</div>
<div class="Content" style="text-align: justify;">
<div class="hddn">
<ul>
<li>Then we need to specify that our module depends on ngRoute module to be able to use it.</li>
</ul>
</div>
</div>
<div class="subheading" style="text-align: justify;">
<h2 id="syntax">Syntax :</h2>
<div class="code-embed-wrapper"> <div class="code-embed-infos"> </div> <pre class="language-javascript code-embed-pre line-numbers"  data-start="1" data-line-offset="0"><code class="language-javascript code-embed-code">var app = angular.module(&#039;myApp&#039;, [&#039;ngRoute&#039;]);</code></pre> </div>
</div>
<div class="Content" style="text-align: justify;">
<div class="hddn">
<ul>
<li>Then we need to specify the place where HTML of each page will be placed in our layout. There is a ng-view directive for that.</li>
</ul>
</div>
</div>
<div class="TextHeading" style="text-align: justify;">
<div class="hddn">
<h2 id="ng-view" class="color-green">ng-view</h2>
</div>
</div>
<div class="Content" style="text-align: justify;">
<div class="hddn">
<ul>
<li>ng-view is an Angular directive that will include the template of the current route (for example, /blog or /about) in the main layout file.</li>
<li>In plain words, it takes the file we specified for current route and injects it into the layout in the place of ng-view directive.</li>
</ul>
</div>
</div>
<div class="subheading" style="text-align: justify;">
<h2 id="example-1">Example 1</h2>
<div class="code-embed-wrapper"> <div class="code-embed-infos"> </div> <pre class="language-markup code-embed-pre line-numbers"  data-start="1" data-line-offset="0"><code class="language-markup code-embed-code">&lt;html ng-app=&quot;myApp&quot;&gt;<br/>&lt;head&gt;<br/>&lt;script src=&quot;https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.4.7/angular.min.js&quot;&gt;&lt;/script&gt;<br/>&lt;script src=&quot;https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.4.7/angular-route.min.js&quot;&gt;&lt;/script&gt;<br/>&lt;/head&gt;<br/>&lt;body&gt;<br/><br/>&lt;div ng-view&gt;&lt;/div&gt;<br/><br/>&lt;script src=&quot;app.js&quot;&gt;&lt;/script&gt;<br/>&lt;/body&gt;&lt;/html&gt;</code></pre> </div>
<p>&nbsp;</p>
</div>
<div class="CodeContent" style="text-align: justify;">
<div class="hddn">
<figure class="highlight">When HTML is ready, we need to configure our routes. We will use $route Provider service from the ngRoute module.</figure>
</div>
</div>
<div class="Content" style="text-align: justify;">
<div class="hddn">
<ul>
<li>For each route, we need to specify template Url and controller.</li>
<li>If user will try to go to the route that does not exist, we can handle this by using otherwise function. In our case, we will redirect user to the “/” route:</li>
</ul>
</div>
</div>
<div class="subheading" style="text-align: justify;">
<h2 id="syntax-2">Syntax :</h2>
<div class="code-embed-wrapper"> <div class="code-embed-infos"> </div> <pre class="language-javascript code-embed-pre line-numbers"  data-start="1" data-line-offset="0"><code class="language-javascript code-embed-code">var app = angular.module(&#039;myApp&#039;, [&#039;ngRoute&#039;]);</code></pre> </div>
</div>
<div class="CodeContent" style="text-align: justify;">
<div class="hddn">
<figure class="highlight">
<pre>Example 2 :</pre>
</figure>
</div>
</div>
<div class="CodeContent" style="text-align: justify;">
<div class="hddn">
<figure class="highlight"><div class="code-embed-wrapper"> <div class="code-embed-infos"> </div> <pre class="language-markup code-embed-pre line-numbers"  data-start="1" data-line-offset="0"><code class="language-markup code-embed-code">&lt;head&gt;<br/>&lt;script src=&quot;https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.4.7/angular.min.js&quot;&gt;&lt;/script&gt;<br/>&lt;script src=&quot;https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.4.7/angular-route.min.js&quot;&gt;&lt;/script&gt;<br/>&lt;/head&gt;<br/>&lt;body&gt;<br/>&lt;script type=&quot;text/ng-template&quot; id=&quot;pages/home.html&quot;&gt;<br/>&lt;h1&gt;Home&lt;/h1&gt;<br/>&lt;h3&gt;{{message}}&lt;/h3&gt;<br/>&lt;/script&gt;<br/>&lt;script type=&quot;text/ng-template&quot; id=&quot;pages/blog.html&quot;&gt;<br/>&lt;h1&gt;Blog&lt;/h1&gt;<br/>&lt;h3&gt;{{message}}&lt;/h3&gt;<br/>&lt;/script&gt;<br/>&lt;script type=&quot;text/ng-template&quot; id=&quot;pages/about.html&quot;&gt;<br/>&lt;h1&gt;About&lt;/h1&gt;<br/>&lt;h3&gt;{{message}}&lt;/h3&gt;<br/>&lt;/script&gt;<br/><br/>&lt;a href=&quot;#/&quot;&gt;Home&lt;/a&gt;<br/>&lt;a href=&quot;#/blog&quot;&gt;Blog&lt;/a&gt;<br/>&lt;a href=&quot;#/about&quot;&gt;About&lt;/a&gt;<br/><br/>&lt;div ng-view&gt;&lt;/div&gt;<br/><br/>&lt;script src=&quot;app.js&quot;&gt;&lt;/script&gt;<br/>&lt;/body&gt;&lt;/html&gt;</code></pre> </div></figure>
</div>
</div>
]]></content:encoded>
					
					<wfw:commentRss>https://www.wikitechy.com/interview-questions/angularjs/what-is-spa-in-angularjs/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
