<?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>$http in Angular JS &#8211; Sibeesh Passion</title>
	<atom:link href="https://sibeeshpassion.com/tag/http-in-angular-js/feed/" rel="self" type="application/rss+xml" />
	<link>https://sibeeshpassion.com</link>
	<description>My passion towards life</description>
	<lastBuildDate>Mon, 10 Jun 2019 17:22:04 +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>/wp-content/uploads/2017/04/Sibeesh_Passion_Logo_Small.png</url>
	<title>$http in Angular JS &#8211; Sibeesh Passion</title>
	<link>https://sibeeshpassion.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Load XML And Show As li In Angular JS</title>
		<link>https://sibeeshpassion.com/load-xml-and-show-as-li-in-angular-js/</link>
					<comments>https://sibeeshpassion.com/load-xml-and-show-as-li-in-angular-js/#disqus_thread</comments>
		
		<dc:creator><![CDATA[SibeeshVenu]]></dc:creator>
		<pubDate>Wed, 04 Nov 2015 05:02:24 +0000</pubDate>
				<category><![CDATA[Angular]]></category>
		<category><![CDATA[CodeProject]]></category>
		<category><![CDATA[$http in Angular JS]]></category>
		<category><![CDATA[Angular JS]]></category>
		<category><![CDATA[Convert XML to JSON In Angular JS]]></category>
		<category><![CDATA[Load XML And Show As li In Angular JS]]></category>
		<category><![CDATA[ng-repeat]]></category>
		<category><![CDATA[XML to LI in Angular JS]]></category>
		<guid isPermaLink="false">http://sibeecst_passion.com/?p=10907</guid>

					<description><![CDATA[In this post we will see how we can load an XML file and show as li using ng-repeat in Angular JS. As you all know Angular JS is a JavaScript framework for developing applications. So basically Angular JS expects the response in the form of JSON. Hence it is recommended to return the data in JSON format before you start to work on the data. Here in this post we will load a local XML file using Angular JS $http service, and we will convert the same XML file to JSON. Once it is converted, we will loop through [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>In this post we will see how we can load an XML file and show as li using ng-repeat in Angular JS. As you all know Angular JS is a JavaScript framework for developing applications. So basically Angular JS expects the response in the form of JSON. Hence it is recommended to return the data in JSON format before you start to work on the data. Here in this post we will load a local XML file using Angular JS $http service, and we will convert the same XML file to JSON. Once it is converted, we will loop through the JSON and show it as li using ng-repeat. If you are new to Angular JS, please read here: <a href="http://sibeeshpassion.com/category/angularjs/" target="_blank">Angular JS</a>. I hope you will like this article. </p>
<p><strong>Background</strong></p>
<p>I have already posted an article related to $http service in Angular JS, you can see here: <a href="http://sibeeshpassion.com/learning-angularjs-http/" target="_blank">$http Service In Angular JS</a></p>
<p>To convert your XML file to JSON, I recommend you to read here: <a href="http://sibeeshpassion.com/convert-xml-to-json-in-angular-js/" target="_blank">XML to JSON In Angular JS</a></p>
<p><strong>Source Code</strong></p>
<p>Please download the source code here: <a href="http://sibeeshpassion.com/download/LOADXMLASLI.rar" target="_blank">XML to Li Source Code</a></p>
<p><strong>Using the code</strong></p>
<p>Create an html page first.</p>
<p>[html]<br />
&lt;!DOCTYPE html&gt;<br />
&lt;html&gt;<br />
&lt;head&gt;<br />
    &lt;title&gt;Load XML And Show As li In Angular JS &#8211; sibeeshpassion &lt;/title&gt;<br />
&lt;/head&gt;<br />
&lt;body&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;<br />
[/html]</p>
<p>Now add the needed reference as follows. </p>
<p>[js]<br />
&lt;script src=&quot;jquery-2.1.3.min.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script src=&quot;angular.min.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script src=&quot;xml2json.js&quot;&gt;&lt;/script&gt;<br />
[/js]</p>
<blockquote><p>Have you noticed that I have added xml2json.js file? This is the file which is doing the conversion part. You can always download the file from <a href="https://code.google.com/p/x2js/" target="_blank">https://code.google.com/p/x2js/</a></p></blockquote>
<p>So if you read and implement as explained in my article on converting XML file to JSON in Angular JS, Your page will be looking as follows. </p>
<p>[html]<br />
&lt;!DOCTYPE html&gt;<br />
&lt;html&gt;<br />
&lt;head&gt;<br />
    &lt;title&gt;Convert XML to JSON In Angular JS &#8211; sibeeshpassion &lt;/title&gt;<br />
    &lt;script src=&quot;jquery-2.1.3.min.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script src=&quot;angular.min.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script src=&quot;xml2json.js&quot;&gt;&lt;/script&gt;<br />
&lt;/head&gt;<br />
&lt;body&gt;<br />
    &lt;div ng-app=&quot;httpApp&quot; ng-controller=&quot;httpController&quot;&gt;<br />
    &lt;/div&gt;<br />
    &lt;script&gt;<br />
        var app = angular.module(&#8216;httpApp&#8217;, []);<br />
        app.controller(&#8216;httpController&#8217;, function ($scope, $http) {<br />
            $http.get(&quot;Sitemap.xml&quot;,<br />
                    {<br />
                        transformResponse: function (cnv) {<br />
                            var x2js = new X2JS();<br />
                            var aftCnv = x2js.xml_str2json(cnv);<br />
                            return aftCnv;<br />
                        }<br />
                    })<br />
            .success(function (response) {<br />
                console.log(response);<br />
            });<br />
        });<br />
    &lt;/script&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;<br />
[/html]</p>
<p>So we have loaded our XML and converted the it to the JSON. Now we need to show this JSON response as li using ng-repeat in Angular JS. Are you ready?</p>
<p>For that please change your ng-app directive as follows.</p>
<p>[html]<br />
&lt;div ng-app=&quot;httpApp&quot; ng-controller=&quot;httpController&quot;&gt;<br />
        &lt;ul&gt;<br />
            &lt;li ng-repeat=&quot;det in details&quot;&gt;&lt;a href=&quot;{{det.loc }}&quot;&gt;{{det.loc }}&lt;/a&gt;<br />
            &lt;/li&gt;<br />
        &lt;/ul&gt;<br />
    &lt;/div&gt;<br />
[/html]</p>
<p>And we can change our Angular script implementation as below.</p>
<p>[js]<br />
  &lt;script&gt;<br />
        var app = angular.module(&#8216;httpApp&#8217;, []);<br />
        app.controller(&#8216;httpController&#8217;, function ($scope, $http) {<br />
            $http.get(&quot;Sitemap.xml&quot;,<br />
                    {<br />
                        transformResponse: function (cnv) {<br />
                            var x2js = new X2JS();<br />
                            var aftCnv = x2js.xml_str2json(cnv);<br />
                            return aftCnv;<br />
                        }<br />
                    })<br />
            .success(function (response) {<br />
                $scope.details = response.urlset.url;<br />
                console.log(response);<br />
            });<br />
        });<br />
    &lt;/script&gt;<br />
[/js]</p>
<p>So we are assigning response.urlset.url to the $scope.details so that we can simply loop through using ng-repeat as<br />
<em>det in details</em>. </p>
<p>If you download the sitemap.xml file from the source code given you can get to know the XML structure of the data. Depends on the data structure we need to assign the response to the $scope. </p>
<p>I guess everything is done, now we can see the output. </p>
<p><strong>Output</strong></p>
<div id="attachment_10922" style="width: 660px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2015/11/Load-XML-And-Show-As-li-In-Angular-JS-e1446613118202.png"><img fetchpriority="high" decoding="async" aria-describedby="caption-attachment-10922" src="http://sibeeshpassion.com/wp-content/uploads/2015/11/Load-XML-And-Show-As-li-In-Angular-JS-e1446613118202.png" alt="Load XML And Show As li In Angular JS" width="650" height="561" class="size-full wp-image-10922" srcset="/wp-content/uploads/2015/11/Load-XML-And-Show-As-li-In-Angular-JS-e1446613118202.png 650w, /wp-content/uploads/2015/11/Load-XML-And-Show-As-li-In-Angular-JS-e1446613118202-300x259.png 300w, /wp-content/uploads/2015/11/Load-XML-And-Show-As-li-In-Angular-JS-e1446613118202-400x345.png 400w" sizes="(max-width: 650px) 100vw, 650px" /></a><p id="caption-attachment-10922" class="wp-caption-text">Load XML And Show As li In Angular JS</p></div>
<p>That&#8217;s all we have done everything. Happy coding!.</p>
<p><strong>Complete Code</strong></p>
<p>[html]<br />
&lt;!DOCTYPE html&gt;<br />
&lt;html&gt;<br />
&lt;head&gt;<br />
    &lt;title&gt;Load XML And Show As li In Angular JS &#8211; sibeeshpassion &lt;/title&gt;<br />
    &lt;script src=&quot;jquery-2.1.3.min.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script src=&quot;angular.min.js&quot;&gt;&lt;/script&gt;<br />
    &lt;script src=&quot;xml2json.js&quot;&gt;&lt;/script&gt;<br />
&lt;/head&gt;<br />
&lt;body&gt;<br />
    &lt;div ng-app=&quot;httpApp&quot; ng-controller=&quot;httpController&quot;&gt;<br />
        &lt;ul&gt;<br />
            &lt;li ng-repeat=&quot;det in details&quot;&gt;&lt;a href=&quot;{{det.loc }}&quot;&gt;{{det.loc }}&lt;/a&gt;<br />
            &lt;/li&gt;<br />
        &lt;/ul&gt;<br />
    &lt;/div&gt;<br />
    &lt;script&gt;<br />
        var app = angular.module(&#8216;httpApp&#8217;, []);<br />
        app.controller(&#8216;httpController&#8217;, function ($scope, $http) {<br />
            $http.get(&quot;Sitemap.xml&quot;,<br />
                    {<br />
                        transformResponse: function (cnv) {<br />
                            var x2js = new X2JS();<br />
                            var aftCnv = x2js.xml_str2json(cnv);<br />
                            return aftCnv;<br />
                        }<br />
                    })<br />
            .success(function (response) {<br />
                $scope.details = response.urlset.url;<br />
                console.log(response);<br />
            });<br />
        });<br />
    &lt;/script&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;<br />
[/html]</p>
<p><strong>Conclusion</strong></p>
<p>Did I miss anything that you may think which is needed? Could you find this post as useful? I hope you liked this article. Please share me your valuable suggestions and feedback.</p>
<p><strong>Your turn. What do you think?</strong></p>
<p>A blog isn’t a blog without comments, but do try to stay on topic. If you have a question unrelated to this post, you’re better off posting it on C# Corner, Code Project, Stack Overflow, Asp.Net Forum instead of commenting here. Tweet or email me a link to your question there and I’ll definitely try to help if I can.</p>
<p>Kindest Regards<br />
Sibeesh Venu</p>
]]></content:encoded>
					
					<wfw:commentRss>https://sibeeshpassion.com/load-xml-and-show-as-li-in-angular-js/feed/</wfw:commentRss>
			<slash:comments>4</slash:comments>
		
		
			</item>
		<item>
		<title>Convert XML to JSON In Angular JS</title>
		<link>https://sibeeshpassion.com/convert-xml-to-json-in-angular-js/</link>
					<comments>https://sibeeshpassion.com/convert-xml-to-json-in-angular-js/#disqus_thread</comments>
		
		<dc:creator><![CDATA[SibeeshVenu]]></dc:creator>
		<pubDate>Tue, 03 Nov 2015 11:41:16 +0000</pubDate>
				<category><![CDATA[Angular]]></category>
		<category><![CDATA[$http in Angular JS]]></category>
		<category><![CDATA[Angular JS]]></category>
		<category><![CDATA[Convert XML to JSON In Angular JS]]></category>
		<category><![CDATA[transformRequest]]></category>
		<category><![CDATA[transformResponse]]></category>
		<category><![CDATA[XML to JSON]]></category>
		<guid isPermaLink="false">http://sibeecst_passion.com/?p=10903</guid>

					<description><![CDATA[[toc] Introduction In this post we will see how we can convert an XML file to JSON in Angular JS. As you all know Angular JS is a JavaScript framework for developing applications. So basically Angular JS expects the response in the form of JSON. Hence it is recommended to return the data in JSON format before you start to work on the data. Here in this post we will load a local XML file using Angular JS $http service, and we will convert the same XML file to JSON. If you are new to Angular JS, please read here: [&#8230;]]]></description>
										<content:encoded><![CDATA[
<p>[toc]</p>



<h2 class="wp-block-heading">Introduction</h2>



<p>In this post we will see how we can convert an XML file to <a href="http://sibeeshpassion.com/category/json/" target="_blank" rel="noopener noreferrer">JSON </a>in Angular JS. As you all know Angular JS is a JavaScript framework for developing applications. So basically Angular JS expects the response in the form of JSON. Hence it is recommended to return the data in JSON format before you start to work on the data. Here in this post we will load a local XML file using Angular JS $http service, and we will convert the same XML file to JSON. If you are new to Angular JS, please read here: <a href="http://sibeeshpassion.com/category/angularjs/" target="_blank" rel="noopener noreferrer">Angular JS</a>. I hope you will like this article.</p>



<h2 class="wp-block-heading">Background</h2>



<p>I have already posted an article related to $http service in Angular JS, you can see here: <a href="http://sibeeshpassion.com/learning-angularjs-http/" target="_blank" rel="noopener noreferrer">$http Service In Angular JS</a></p>



<h2 class="wp-block-heading">Source Code</h2>



<p>Please download the source code here: <a href="https://code.msdn.microsoft.com/Convert-XML-to-JSON-In-d8102421" target="_blank" rel="noopener noreferrer">XML to JSON Source Code</a></p>



<p>You can also fork <a href="https://github.com/SibeeshVenu/XML-to-JSON-in-AngularJS">this repository</a> from GitHub.&nbsp;</p>



<h2 class="wp-block-heading">Using the code</h2>



<p>Create an html page first.</p>



<script src="https://gist.github.com/SibeeshVenu/96950e1ae1cdda2a7d7705da7e122a7c.js"></script>



<p>Now add the needed reference as follows.</p>



<script src="https://gist.github.com/SibeeshVenu/7726d169d7c7911b6cfc9b2144702099.js"></script>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow"><p>Have you noticed that I have added xml2json.js file? This is the file which is doing the conversion part. You can always download the file from <a href="https://code.google.com/p/x2js/" target="_blank" rel="noopener noreferrer">https://code.google.com/p/x2js/</a></p></blockquote>



<p>Now create a controller and app directive as follows.</p>



<script src="https://gist.github.com/SibeeshVenu/779775b210f0665478b74635367663b6.js"></script>



<p>Next thing we need to do is adding the service. You can add the $http service as follows.</p>



<script src="https://gist.github.com/SibeeshVenu/0f3b7d82e5da430df303fe37a31e6e00.js"></script>



<p>Here httpApp is our app and httpController is our controller. And we are transforming our response using the function transformResponse.</p>



<h3 class="wp-block-heading">Transforming Request and Response</h3>



<p>In Angular JS, requests can be transformed using a function called transformRequest and if it is a response we can transform by function transformResponse. These functions returns the transformed values.</p>



<p>Here in our example we are using the transformResponse function as follows.</p>



<script src="https://gist.github.com/SibeeshVenu/b78bc1ed9347749beefe4fe041b8a17c.js"></script>



<p>The x2js.xml_str2json(cnv) will return the json object and we return aftCnv from the function transformResponse. Sounds good? Once we are done everything, we are just write the JSON object in the browser console, so that we can see the object.</p>



<h2 class="wp-block-heading">Output</h2>



<figure class="wp-block-image alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2015/11/Convert_XML_to_JSON_In_Angular_JS-e1446550586662.png"><img decoding="async" width="650" height="379" src="http://sibeeshpassion.com/wp-content/uploads/2015/11/Convert_XML_to_JSON_In_Angular_JS-e1446550586662.png" alt="Convert XML To JSON In Angular JS" class="wp-image-10904" srcset="/wp-content/uploads/2015/11/Convert_XML_to_JSON_In_Angular_JS-e1446550586662.png 650w, /wp-content/uploads/2015/11/Convert_XML_to_JSON_In_Angular_JS-e1446550586662-300x175.png 300w, /wp-content/uploads/2015/11/Convert_XML_to_JSON_In_Angular_JS-e1446550586662-400x233.png 400w" sizes="(max-width: 650px) 100vw, 650px" /></a><figcaption>Convert XML To JSON In Angular JS</figcaption></figure>



<p>That&#8217;s all we have done everything. Happy coding!.</p>



<h2 class="wp-block-heading">Conclusion</h2>



<p>Did I miss anything that you may think which is needed? Could you find this post as useful? I hope you liked this article. Please share me your valuable suggestions and feedback.</p>



<h2 class="wp-block-heading">Your turn. What do you think?</h2>



<p>A blog isn’t a blog without comments, but do try to stay on topic. If you have a question unrelated to this post, you’re better off posting it on C# Corner, Code Project, Stack Overflow, Asp.Net Forum instead of commenting here. Tweet or email me a link to your question there and I’ll definitely try to help if I can.</p>



<p>Kindest Regards<br>Sibeesh Venu</p>


]]></content:encoded>
					
					<wfw:commentRss>https://sibeeshpassion.com/convert-xml-to-json-in-angular-js/feed/</wfw:commentRss>
			<slash:comments>18</slash:comments>
		
		
			</item>
		<item>
		<title>Learning AngularJS: $http</title>
		<link>https://sibeeshpassion.com/learning-angularjs-http/</link>
					<comments>https://sibeeshpassion.com/learning-angularjs-http/#disqus_thread</comments>
		
		<dc:creator><![CDATA[SibeeshVenu]]></dc:creator>
		<pubDate>Sun, 29 Mar 2015 20:18:58 +0000</pubDate>
				<category><![CDATA[Angular]]></category>
		<category><![CDATA[$http]]></category>
		<category><![CDATA[$http in Angular JS]]></category>
		<category><![CDATA[Angular JS]]></category>
		<category><![CDATA[http variable]]></category>
		<category><![CDATA[Learning Angular JS]]></category>
		<guid isPermaLink="false">https://sibeeshpassion.com/?p=1561</guid>

					<description><![CDATA[Hi all, I hope you are fine. Today we will learn about AngularJS Basic $http. If you are new to AngularJS then I suggest you read the Basics of AngularJS. Now with the assumption that you have read my previous article, we are starting. This article explains $http in Angular JS. Using the code $http is a service for reading data from web services. It uses the get (service URL) method for the process. We will see that with an example. [html] &#60;div ng-app=&#34;httpApp&#34; ng-controller=&#34;httpController&#34;&#62; &#60;ul&#62; &#60;li ng-repeat=&#34;det in details&#34;&#62;{{ det.name + &#8216;, &#8216; + det.countrycode }} &#60;/li&#62; &#60;/ul&#62; &#60;/div&#62; [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>Hi all, I hope you are fine. Today we will learn about AngularJS Basic $http. If you are new to AngularJS then I suggest you read the <a href="http://sibeeshpassion.com/basics-of-angularjs/" target="_blank">Basics of AngularJS</a>.</p>
<p>Now with the assumption that you have read my previous article, we are starting.</p>
<p>This article explains $http in Angular JS.</p>
<p><strong>Using the code</strong></p>
<p>$http is a service for reading data from web services. It uses the get (service URL) method for the process. We will see that with an example.<br />
[html]<br />
&lt;div ng-app=&quot;httpApp&quot; ng-controller=&quot;httpController&quot;&gt;<br />
    &lt;ul&gt;<br />
        &lt;li ng-repeat=&quot;det in details&quot;&gt;{{ det.name + &#8216;, &#8216; + det.countrycode }}<br />
&lt;/li&gt;<br />
    &lt;/ul&gt;<br />
&lt;/div&gt;<br />
[/html]</p>
<p>In the preceding code, we have an Angular app httpApp and a controller httpController. Now we need to create our controller part, right?<br />
[js]<br />
&lt; script &gt;<br />
var app = angular.module(&#8216;httpApp&#8217;, []);<br />
app.controller(&#8216;httpController&#8217;, function($scope, $http) {<br />
    $http.get(&quot;http://api.geonames.org/citiesJSON?north=44.1&amp;south=-9.9&amp;east=- 22.4&amp;west=55.2&amp;lang=de&amp;username=demo&quot;)<br />
        .success(function(response) {<br />
        $scope.details = response.geonames;<br />
    });<br />
}); &lt; /script&gt;<br />
[/js]</p>
<p>In the preceding code we are using the $http.get() method of Angular. In the URL part we have given a sample web service URL of geo data. You can get these free web services here.</p>
<p>So in the success part we are returning the response of the web service. </p>
<p>Now if you write the response.geonames in the success in the browser console as follows, you will get the array as shown below.</p>
<p>console.log(response.geonames);  </p>
<p><div id="attachment_9941" style="width: 644px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2015/03/Learning-AngularJS-http1.png"><img decoding="async" aria-describedby="caption-attachment-9941" src="http://sibeeshpassion.com/wp-content/uploads/2015/03/Learning-AngularJS-http1-1024x516.png" alt="Learning AngularJS http" width="634" height="319" class="size-large wp-image-9941" srcset="/wp-content/uploads/2015/03/Learning-AngularJS-http1.png 1024w, /wp-content/uploads/2015/03/Learning-AngularJS-http1-300x151.png 300w, /wp-content/uploads/2015/03/Learning-AngularJS-http1-768x387.png 768w, /wp-content/uploads/2015/03/Learning-AngularJS-http1-400x202.png 400w" sizes="(max-width: 634px) 100vw, 634px" /></a><p id="caption-attachment-9941" class="wp-caption-text">Learning AngularJS http</p></div><br />
Once it is returned we are showing the response data to the UI using the repeat directive.</p>
<p>So that is all.</p>
<p><strong>Output</strong></p>
<p><div id="attachment_9951" style="width: 449px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2015/03/Learning-AngularJS-http2.png"><img decoding="async" aria-describedby="caption-attachment-9951" src="http://sibeeshpassion.com/wp-content/uploads/2015/03/Learning-AngularJS-http2.png" alt="Learning AngularJS http" width="439" height="261" class="size-full wp-image-9951" srcset="/wp-content/uploads/2015/03/Learning-AngularJS-http2.png 439w, /wp-content/uploads/2015/03/Learning-AngularJS-http2-300x178.png 300w, /wp-content/uploads/2015/03/Learning-AngularJS-http2-400x238.png 400w" sizes="(max-width: 439px) 100vw, 439px" /></a><p id="caption-attachment-9951" class="wp-caption-text">Learning AngularJS http</p></div></p>
<p>Now apply the CSS</p>
<p>Add the following CSS to your page.<br />
[css]<br />
&lt; style &gt; li {<br />
    border: 1px solid#ccc;<br />
    border &#8211; right: none;<br />
    border &#8211; left: none;<br />
    padding: 2px;<br />
    text &#8211; align: center;<br />
    list &#8211; style: none;<br />
} &lt; /style&gt;<br />
[/css]</p>
<p>Once you add the CSS you will get output as follows.</p>
<p><div id="attachment_9961" style="width: 644px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2015/03/Learning-AngularJS-http3.png"><img decoding="async" aria-describedby="caption-attachment-9961" src="http://sibeeshpassion.com/wp-content/uploads/2015/03/Learning-AngularJS-http3-1024x229.png" alt="Learning AngularJS http" width="634" height="142" class="size-large wp-image-9961" srcset="/wp-content/uploads/2015/03/Learning-AngularJS-http3.png 1024w, /wp-content/uploads/2015/03/Learning-AngularJS-http3-300x67.png 300w, /wp-content/uploads/2015/03/Learning-AngularJS-http3-768x172.png 768w, /wp-content/uploads/2015/03/Learning-AngularJS-http3-400x89.png 400w" sizes="(max-width: 634px) 100vw, 634px" /></a><p id="caption-attachment-9961" class="wp-caption-text">Learning AngularJS http</p></div></p>
<p>Cool. We did it.</p>
<p><strong>Complete HTML</strong><br />
[html]<br />
&lt;!DOCTYPE html&gt;<br />
&lt;html<br />
    xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;<br />
    &lt;head&gt;<br />
        &lt;title&gt;Angular $http &#8211; sibeeshpassion &lt;/title&gt;<br />
        &lt;style&gt;<br />
         li {<br />
            border: 1px solid #ccc;<br />
            border-right: none;<br />
            border-left: none;<br />
            padding: 2px;<br />
            text-align: center;<br />
            list-style:none;<br />
          }<br />
         &lt;/style&gt;<br />
        &lt;script src=&quot;https://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js&quot;&gt;&lt;/script&gt;<br />
    &lt;/head&gt;<br />
    &lt;body&gt;<br />
        &lt;div ng-app=&quot;httpApp&quot; ng-controller=&quot;httpController&quot;&gt;<br />
            &lt;ul&gt;<br />
                &lt;li ng-repeat=&quot;det in details&quot;&gt;{{ det.name + &#8216;, &#8216; + det.countrycode }} &lt;/li&gt;<br />
            &lt;/ul&gt;<br />
        &lt;/div&gt;<br />
        &lt;script&gt;<br />
            var app = angular.module(&#8216;httpApp&#8217;, []);<br />
            app.controller(&#8216;httpController&#8217;, function ($scope, $http) {<br />
            $http.get(&quot;http://api.geonames.org/citiesJSON?north=44.1&amp;south=-9.9&amp;east=-22.4&amp;west=55.2&amp;lang=de&amp;username=sibeeshvenu&quot;)<br />
            .success(function (response) {<br />
               $scope.details = response.geonames;<br />
               console.log(response.geonames);<br />
               });<br />
         });<br />
         &lt;/script&gt;<br />
    &lt;/body&gt;<br />
&lt;/html&gt;<br />
[/html]</p>
<p><strong>Conclusion</strong></p>
<p>Now that is all for the day, I will return with another set of items in Angular JS soon. I hope you liked this article. Please provide your valuable suggestions.</p>
<p>Kindest Regards<br />
Sibeesh venu</p>
]]></content:encoded>
					
					<wfw:commentRss>https://sibeeshpassion.com/learning-angularjs-http/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
	</channel>
</rss>
