<?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 coding interview questions - Wikitechy</title>
	<atom:link href="https://www.wikitechy.com/interview-questions/tag/angularjs-coding-interview-questions/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.wikitechy.com/interview-questions/tag/angularjs-coding-interview-questions/</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>angularjs coding interview questions - Wikitechy</title>
	<link>https://www.wikitechy.com/interview-questions/tag/angularjs-coding-interview-questions/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>What is the difference between Angularjs and Polymer ?</title>
		<link>https://www.wikitechy.com/interview-questions/angularjs/what-is-the-difference-between-angularjs-and-polymer/</link>
					<comments>https://www.wikitechy.com/interview-questions/angularjs/what-is-the-difference-between-angularjs-and-polymer/#respond</comments>
		
		<dc:creator><![CDATA[Editor]]></dc:creator>
		<pubDate>Sun, 11 Jul 2021 13:09:56 +0000</pubDate>
				<category><![CDATA[Angularjs]]></category>
		<category><![CDATA[Accenture interview questions and answers]]></category>
		<category><![CDATA[advanced angularjs interview questions]]></category>
		<category><![CDATA[angular 4 vs polymer 2]]></category>
		<category><![CDATA[angularjs 2 interview questions and answers for experienced]]></category>
		<category><![CDATA[angularjs 2 vs polymer]]></category>
		<category><![CDATA[angularjs and polymer]]></category>
		<category><![CDATA[angularjs coding interview questions]]></category>
		<category><![CDATA[angularjs coding test]]></category>
		<category><![CDATA[angularjs interview questions codeproject]]></category>
		<category><![CDATA[angularjs polymer integration]]></category>
		<category><![CDATA[angularjs tricky interview questions]]></category>
		<category><![CDATA[Capgemini interview questions and answers]]></category>
		<category><![CDATA[CASTING NETWORKS INDIA PVT LIMITED interview questions and answers]]></category>
		<category><![CDATA[CGI Group Inc interview questions and answers]]></category>
		<category><![CDATA[Chetu interview quest interview questions and answers]]></category>
		<category><![CDATA[Ciber Global Solutions interview questions and answers]]></category>
		<category><![CDATA[Cogent Data Solutions interview questions and answers]]></category>
		<category><![CDATA[Collabera Technologies interview questions and answers]]></category>
		<category><![CDATA[Conduent interview questions and answers]]></category>
		<category><![CDATA[Cybage interview questions and answers]]></category>
		<category><![CDATA[Datamatics Global Services Ltd interview questions and answers]]></category>
		<category><![CDATA[Dell International Services India Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[difference between angularjs and nodejs]]></category>
		<category><![CDATA[difference between angularjs and reactjs]]></category>
		<category><![CDATA[IBM interview questions and answers]]></category>
		<category><![CDATA[Indecomm Global Services interview questions and answers]]></category>
		<category><![CDATA[L&T Infotech interview questions and answers]]></category>
		<category><![CDATA[Oracle Corporation interview questions and answers]]></category>
		<category><![CDATA[PeopleStrong interview questions and answers]]></category>
		<category><![CDATA[Persistent Systems interview questions and answers]]></category>
		<category><![CDATA[Photon Intera interview questions and answers]]></category>
		<category><![CDATA[polymer 2 vs react]]></category>
		<category><![CDATA[polymer angular 4]]></category>
		<category><![CDATA[polymer angularjs]]></category>
		<category><![CDATA[polymer inside react]]></category>
		<category><![CDATA[polymer js vs angularjs]]></category>
		<category><![CDATA[polymer server side rendering]]></category>
		<category><![CDATA[polymer vs angular 2017]]></category>
		<category><![CDATA[polymer vs angular 4]]></category>
		<category><![CDATA[polymer vs angular vs react]]></category>
		<category><![CDATA[polymer vs react]]></category>
		<category><![CDATA[polymer vs react vs angular]]></category>
		<category><![CDATA[Prokarma Softech Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[R Systems interview questions and answers]]></category>
		<category><![CDATA[SAP Labs India Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[Tech Mahindra interview questions and answers]]></category>
		<category><![CDATA[UnitedHealth Group interview questions and answers]]></category>
		<category><![CDATA[using polymer with angular 2]]></category>
		<category><![CDATA[ValueLabs interview questions and answers]]></category>
		<category><![CDATA[Virtusa Consulting Services Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[Xoriant Solutions Pvt Ltd interview questions and answers]]></category>
		<guid isPermaLink="false">https://www.wikitechy.com/interview-questions/?p=111</guid>

					<description><![CDATA[Answer : Angular is a framework written using javascript and is made for building single-page...]]></description>
										<content:encoded><![CDATA[<div class="row">
<div class="col-sm-12">
<div class="TextHeading">
<div class="hddn">
<h2 id="difference-between-angularjs-and-polymer" class="color-green">Difference between Angularjs and Polymer</h2>
</div>
</div>
<div class="Content">
<div class="hddn"></div>
</div>
</div>
</div>
<table class="table-bordered table-striped table table-responsive">
<tbody>
<tr>
<th>Angularjs</th>
<th>Polymer</th>
</tr>
<tr>
<td class="text-leftalign">Angular is a framework written using javascript and is<br />
made for building single-page web applications.</td>
<td class="text-leftalign">Polymer&#8217;s webcomponents.js is a library that contains several polyfills for various W3C APIs that fall under the Web Components umbrella.</td>
</tr>
<tr>
<td class="text-leftalign">Angular&#8217;s data binding and dependency injection eliminate<br />
much of the code writing.It happens within the browser,<br />
making it an ideal partner with any server technology.</td>
<td class="text-leftalign">Polymer is a library that aims to use (and show how to use) Web Components.Its foundation is Custom Elements (e.g. everything you build is a web component) and it evolves as the web evolves.</td>
</tr>
</tbody>
</table>
<div class="ImageContent">
<div class="hddn"><img decoding="async" class="img-responsive center-block aligncenter" src="https://cdn.wikitechy.com/interview-questions/angularjs/angularjs-and-polymer.png" alt="angularjs and polymer" /></div>
</div>
<p align="center">
<p align="center">
]]></content:encoded>
					
					<wfw:commentRss>https://www.wikitechy.com/interview-questions/angularjs/what-is-the-difference-between-angularjs-and-polymer/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>What is the difference between Angularjs and Django ?</title>
		<link>https://www.wikitechy.com/interview-questions/angularjs/what-is-the-difference-between-angularjs-and-django/</link>
					<comments>https://www.wikitechy.com/interview-questions/angularjs/what-is-the-difference-between-angularjs-and-django/#respond</comments>
		
		<dc:creator><![CDATA[Editor]]></dc:creator>
		<pubDate>Sun, 11 Jul 2021 13:03:33 +0000</pubDate>
				<category><![CDATA[Angularjs]]></category>
		<category><![CDATA[Accenture interview questions and answers]]></category>
		<category><![CDATA[advanced angularjs interview questions]]></category>
		<category><![CDATA[angular 4 django rest framework]]></category>
		<category><![CDATA[angular django rest framework]]></category>
		<category><![CDATA[angularjs 2 interview questions and answers for experienced]]></category>
		<category><![CDATA[angularjs 2 interview questions and answers for experienceddjango angular template]]></category>
		<category><![CDATA[angularjs coding interview questions]]></category>
		<category><![CDATA[angularjs coding test]]></category>
		<category><![CDATA[angularjs django forms]]></category>
		<category><![CDATA[angularjs django rest framework]]></category>
		<category><![CDATA[angularjs django rest framework authentication]]></category>
		<category><![CDATA[angularjs interview questions codeproject]]></category>
		<category><![CDATA[angularjs tricky interview questions]]></category>
		<category><![CDATA[angularjs with django]]></category>
		<category><![CDATA[building web applications with django and angularjs]]></category>
		<category><![CDATA[Capgemini interview questions and answers]]></category>
		<category><![CDATA[CASTING NETWORKS INDIA PVT LIMITED interview questions and answers]]></category>
		<category><![CDATA[CGI Group Inc interview questions and answers]]></category>
		<category><![CDATA[Chetu interview quest interview questions and answers]]></category>
		<category><![CDATA[Ciber Global Solutions interview questions and answers]]></category>
		<category><![CDATA[Cogent Data Solutions interview questions and answers]]></category>
		<category><![CDATA[Collabera Technologies interview questions and answers]]></category>
		<category><![CDATA[Conduent interview questions and answers]]></category>
		<category><![CDATA[Cybage interview questions and answers]]></category>
		<category><![CDATA[Datamatics Global Services Ltd interview questions and answers]]></category>
		<category><![CDATA[Dell International Services India Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[django angular 2]]></category>
		<category><![CDATA[django angular 4]]></category>
		<category><![CDATA[django angularjs example]]></category>
		<category><![CDATA[django angularjs mongodb]]></category>
		<category><![CDATA[django angularjs template]]></category>
		<category><![CDATA[django rest framework angularjs]]></category>
		<category><![CDATA[IBM interview questions and answers]]></category>
		<category><![CDATA[Indecomm Global Services interview questions and answers]]></category>
		<category><![CDATA[L&T Infotech interview questions and answers]]></category>
		<category><![CDATA[Oracle Corporation interview questions and answers]]></category>
		<category><![CDATA[PeopleStrong interview questions and answers]]></category>
		<category><![CDATA[Persistent Systems interview questions and answers]]></category>
		<category><![CDATA[Photon Intera interview questions and answers]]></category>
		<category><![CDATA[Prokarma Softech Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[R Systems interview questions and answers]]></category>
		<category><![CDATA[SAP Labs India Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[Tech Mahindra interview questions and answers]]></category>
		<category><![CDATA[UnitedHealth Group interview questions and answers]]></category>
		<category><![CDATA[using angularjs with django]]></category>
		<category><![CDATA[ValueLabs interview questions and answers]]></category>
		<category><![CDATA[Virtusa Consulting Services Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[web development with django and angularjs]]></category>
		<category><![CDATA[Xoriant Solutions Pvt Ltd interview questions and answers]]></category>
		<guid isPermaLink="false">https://www.wikitechy.com/interview-questions/?p=110</guid>

					<description><![CDATA[Answer : AngularJS is a independent framework...]]></description>
										<content:encoded><![CDATA[<div class="TextHeading">
<div class="hddn">
<h2 id="difference-between-angularjs-and-django" class="color-purple" style="text-align: justify;">Difference between Angularjs and Django</h2>
</div>
</div>
<div class="Content" style="text-align: justify;">
<div class="hddn"></div>
</div>
<table class="table-bordered table-striped table table-responsive">
<tbody>
<tr>
<th>Angularjs</th>
<th>Django</th>
</tr>
<tr>
<td class="text-leftalign">It’s a independent framework</td>
<td class="text-leftalign">It’s a independent framework</td>
</tr>
<tr>
<td class="text-leftalign">Is a frontend MVC framework build upon &#8216;JavaScript&#8217;.</td>
<td class="text-leftalign">Is a backend framework for python web language build upon &#8216;Python&#8217;.</td>
</tr>
</tbody>
</table>
<div class="ImageContent" style="text-align: justify;">
<div class="hddn"><img decoding="async" class="img-responsive center-block aligncenter" src="https://cdn.wikitechy.com/interview-questions/angularjs/angularjs.png" alt="angularjs" /></div>
</div>
<p style="text-align: justify;" align="center">
]]></content:encoded>
					
					<wfw:commentRss>https://www.wikitechy.com/interview-questions/angularjs/what-is-the-difference-between-angularjs-and-django/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>What is the difference between Angularjs and reactjs ?</title>
		<link>https://www.wikitechy.com/interview-questions/angularjs/what-is-the-difference-between-angularjs-and-reactjs/</link>
					<comments>https://www.wikitechy.com/interview-questions/angularjs/what-is-the-difference-between-angularjs-and-reactjs/#respond</comments>
		
		<dc:creator><![CDATA[Editor]]></dc:creator>
		<pubDate>Sat, 10 Jul 2021 19:54:24 +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 2 vs reactjs performance]]></category>
		<category><![CDATA[angularjs and reactjs together]]></category>
		<category><![CDATA[angularjs coding interview questions]]></category>
		<category><![CDATA[angularjs coding test]]></category>
		<category><![CDATA[angularjs interview questions code]]></category>
		<category><![CDATA[angularjs interview questions codeproject]]></category>
		<category><![CDATA[angularjs or reactjs]]></category>
		<category><![CDATA[angularjs reactjs integration]]></category>
		<category><![CDATA[angularjs tricky interview questions]]></category>
		<category><![CDATA[angularjs vs reactjs 2017]]></category>
		<category><![CDATA[angularjs vs reactjs popularity]]></category>
		<category><![CDATA[diff angular react]]></category>
		<category><![CDATA[difference between angularjs and reactjs]]></category>
		<category><![CDATA[react vs angular 2017]]></category>
		<category><![CDATA[react vs angular performance]]></category>
		<category><![CDATA[react vs angular popularity]]></category>
		<category><![CDATA[react vs angular vs vue]]></category>
		<category><![CDATA[reactjs and angularjs]]></category>
		<category><![CDATA[reactjs vs angular 4]]></category>
		<category><![CDATA[reactjs vs angular2]]></category>
		<category><![CDATA[reactjs vs angularjs performance]]></category>
		<category><![CDATA[using reactjs with angularjs]]></category>
		<category><![CDATA[which is easier react or angular]]></category>
		<guid isPermaLink="false">https://www.wikitechy.com/interview-questions/?p=94</guid>

					<description><![CDATA[Answer : AngularJS is developed with the primary purpose of addressing single...]]></description>
										<content:encoded><![CDATA[<div class="TextHeading">
<div class="hddn">
<h2 id="difference-between-angularjs-and-reactjs" class="color-purple" style="text-align: justify;">Difference between Angularjs and reactjs</h2>
</div>
</div>
<table class="table-bordered table-striped table table-responsive">
<tbody>
<tr>
<th>Angularjs</th>
<th>ReactJS</th>
</tr>
<tr>
<td class="text-leftalign">AngularJS is developed with the primary purpose of<br />
addressing single page application development.</td>
<td class="text-leftalign">ReactJS is based on building reusable components of code base which make an app very lightweight, more of a library that makes it quite easy to work with.</td>
</tr>
<tr>
<td class="text-leftalign">AngularJS works with MVC platform.</td>
<td class="text-leftalign">ReactJS provides us high performance<br />
client and server side rendering with a one-way<br />
flow for data binding.</td>
</tr>
<tr>
<td class="text-leftalign">AngularJS follows some guidelines, like Angular data<br />
binding.In Angular, the Model and the View are linked to<br />
allow automatic data synchronization between the two.</td>
<td class="text-leftalign">React is more of a library than a framework.It can be described as an application view that allows the programmer to utilize reusable components again and again.</td>
</tr>
<tr>
<td class="text-leftalign">Complete Framework</p>
<p>AngularJS is complete framework that can run in any<br />
browser or platform.</td>
<td class="text-leftalign">JSX Syntax</p>
<p>JSX is a JS syntax that allows developer to use HTML quotes and usage of HTML tag syntax for subcomponents rendering. It promotes building of machine-readable code and provides ability to compound components in one compile-time verified file.</td>
</tr>
<tr>
<td class="text-leftalign">Two-Way Data Binding</p>
<p>This property is probably the top feature of AngularJS,<br />
as it diffuses the impact after every minor data change and<br />
does way with the need for further effort with data sync in<br />
View and Model.</td>
<td class="text-leftalign">Rendering</p>
<p>Rendering is the best features of React that gives a significant edge over Angular. The technology comprises smart methods to mitigate the amount of DOM operations, optimize and accelerate the updates process.</td>
</tr>
</tbody>
</table>
]]></content:encoded>
					
					<wfw:commentRss>https://www.wikitechy.com/interview-questions/angularjs/what-is-the-difference-between-angularjs-and-reactjs/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>What is Dependency injection in AngularJS ?</title>
		<link>https://www.wikitechy.com/interview-questions/angularjs/what-is-dependency-injection-in-angularjs/</link>
					<comments>https://www.wikitechy.com/interview-questions/angularjs/what-is-dependency-injection-in-angularjs/#respond</comments>
		
		<dc:creator><![CDATA[Editor]]></dc:creator>
		<pubDate>Sat, 10 Jul 2021 19:41:48 +0000</pubDate>
				<category><![CDATA[Angularjs]]></category>
		<category><![CDATA[advanced angularjs interview questions]]></category>
		<category><![CDATA[angular inject service into controller]]></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 dependency injection example]]></category>
		<category><![CDATA[angularjs interview questions codeproject]]></category>
		<category><![CDATA[angularjs tricky interview questions]]></category>
		<category><![CDATA[angularjs tricky interview questionsa]]></category>
		<category><![CDATA[dependency injection angular 2]]></category>
		<category><![CDATA[dvanced angularjs interview questions]]></category>
		<category><![CDATA[factory method in angularjs]]></category>
		<category><![CDATA[how angularjs works internally]]></category>
		<category><![CDATA[injector in angularjs]]></category>
		<category><![CDATA[provider angularjs]]></category>
		<category><![CDATA[what is angularjs]]></category>
		<category><![CDATA[what is dependency injection in angularjs]]></category>
		<category><![CDATA[which components can be injected as a dependency in angularjs mcq]]></category>
		<category><![CDATA[which of provider type can be injected during config phase]]></category>
		<category><![CDATA[which ones are singleton in angularjs?]]></category>
		<category><![CDATA[why use angularjs]]></category>
		<guid isPermaLink="false">https://www.wikitechy.com/interview-questions/?p=99</guid>

					<description><![CDATA[Answer : Dependency Injection is a software design pattern in which an object...]]></description>
										<content:encoded><![CDATA[<div class="TextHeading">
<div class="hddn">
<h2 id="dependency-injection-in-angularjs" class="color-green" style="text-align: justify;">Dependency injection in AngularJS</h2>
</div>
</div>
<div class="Content" style="text-align: justify;">
<div class="hddn">
<ul>
<li>Dependency Injection is a software design pattern in which an object is given its dependencies, rather than the object creating them itself. Design pattern allows us to remove the hard-coded dependencies and making it possible to change them whenever needed.</li>
</ul>
</div>
</div>
<div class="TextHeading" style="text-align: justify;">
<div class="hddn">
<h2 id="why-do-you-need-to-inject-dependencies" class="color-green">Why do you need to inject dependencies ?</h2>
</div>
</div>
<div class="Content" style="text-align: justify;">
<div class="hddn">
<ul>
<li>Separate the process of creation and consumption of dependencies.</li>
<li>Let the consumer worry only about how to use the dependency, and leave the process of creation of the dependency to somebody else.</li>
<li>Allow concurrent/independent development of the dependency and the dependent entity, while only maintaining a known contract.</li>
<li>Facilitate changing of the dependencies when needed.</li>
<li>Allow injecting mock objects as dependencies for testing, by maintaining the agreed contract.</li>
</ul>
</div>
</div>
<div class="text-center row" style="text-align: justify;">
<div class="col-sm-12">
<div id="bsa-zone_1590522538159-8_123456"><span style="font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';">There are only three ways a component (object or function) can get a hold of its dependencies:</span></div>
</div>
</div>
<div class="Content" style="text-align: justify;">
<div class="hddn">
<ul>
<li style="list-style-type: none;">
<ul>
<li>The component can create the dependency, typically using the new operator.</li>
<li>The component can look up the dependency, by referring to a global variable.</li>
<li>The component can have the dependency passed to it where it is needed.</li>
</ul>
</li>
</ul>
</div>
</div>
<div class="Content" style="text-align: justify;">
<div class="hddn">
<ul>
<li>The first two options of creating or looking up dependencies are not optimal because they hard code the dependency to the component. This makes it difficult, if not impossible, to modify the dependencies. This is especially problematic in tests, where it is often desirable to provide mock dependencies for test isolation.</li>
<li>The third option is the most viable, since it removes the responsibility of locating the dependency from the component. The dependency is simply handed to the component.</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-javascript code-embed-pre line-numbers"  data-start="1" data-line-offset="0"><code class="language-javascript code-embed-code">function SomeClass(greeter) <br/>{<br/>this.greeter = greeter;<br/>}<br/>SomeClass.prototype.doSomething = function(name) <br/>{<br/>  this.greeter.greet(name);<br/>}</code></pre> </div>
</div>
<p style="text-align: justify;">This is desirable, but it puts the responsibility of getting hold of the dependency on the code that constructs Some Class.</p>
<div class="ImageContent" style="text-align: justify;">
<div class="hddn"><img decoding="async" class="img-responsive center-block aligncenter" src="https://cdn.wikitechy.com/interview-questions/angularjs/dependency-injection.png" alt=" dependency-injection" /></div>
</div>
<p style="text-align: justify;" align="center">
<p style="text-align: justify;">To manage the responsibility of dependency creation, each AngularJS application has an injector. The injector is a service locator that is responsible for construction and lookup of dependencies.</p>
<div style="text-align: justify;">
<div id="bsa-zone_1590522394795-6_123456"></div>
</div>
<div class="TextHeading" style="text-align: justify;">
<div class="hddn">
<h2 id="using-the-injector-service" class="color-green">Using the injector service:</h2>
</div>
</div>
<div class="subheading" style="text-align: justify;">
<h2 id="syntax">Syntax :</h2>
</div>
<div class="CodeContent" style="text-align: justify;">
<div class="hddn"></div>
</div>
<div class="Content" style="text-align: justify;">
<div class="hddn">
<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">// Provide the wiring information in a module<br/>var myModule = angular.module(&#039;myModule&#039;, []);</code></pre> </div>
<p>Explain the injector how to build a greeter service. Notice that greeter is dependent on the $window service. The greeter service is an object that contains a greet method.</p>
</div>
</div>
<div class="subheading" style="text-align: justify;">
<h2 id="example-2">Example 2</h2>
</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-javascript code-embed-pre line-numbers"  data-start="1" data-line-offset="0"><code class="language-javascript code-embed-code">myModule.factory(&#039;greeter&#039;, function($window) <br/>{<br/>  return <br/>  {<br/>    greet: function(text) <br/>    {<br/>      $window.alert(text);<br/>    }<br/>  };<br/>};</code></pre> </div></figure>
</div>
</div>
]]></content:encoded>
					
					<wfw:commentRss>https://www.wikitechy.com/interview-questions/angularjs/what-is-dependency-injection-in-angularjs/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<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>
