<?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>Various technical Articles to learn AngularJS with easy Examples</title>
	<atom:link href="https://jharaphula.com/category/programming-solutions/learn-angularjs-with-examples/feed/" rel="self" type="application/rss+xml" />
	<link>https://jharaphula.com/category/programming-solutions/learn-angularjs-with-examples/</link>
	<description>Blog for SEO Guest Posting, Digital Marketing or Home Remedies</description>
	<lastBuildDate>Mon, 30 Mar 2026 05:43:01 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9</generator>
	<item>
		<title>How to use restrict option in AngularJS Custom Directive?</title>
		<link>https://jharaphula.com/restrict-option-custom-directive/</link>
					<comments>https://jharaphula.com/restrict-option-custom-directive/#respond</comments>
		
		<dc:creator><![CDATA[Nibedita Panda]]></dc:creator>
		<pubDate>Sat, 03 Feb 2018 16:41:18 +0000</pubDate>
				<category><![CDATA[AngularJS with Examples]]></category>
		<category><![CDATA[AngularJS Custom Directive]]></category>
		<category><![CDATA[AngularJS for absolute Beginners]]></category>
		<category><![CDATA[AngularJS ng-options]]></category>
		<category><![CDATA[Attribute directives]]></category>
		<category><![CDATA[Restrict Option in Angular]]></category>
		<guid isPermaLink="false">http://jharaphula.com/?p=12214</guid>

					<description><![CDATA[<img width="300" height="192" src="https://jharaphula.com/wp-content/uploads/2018/02/Restrict-a-Custom-Directive-300x192.png" class="webfeedsFeaturedVisual wp-post-image" alt="How to use restrict option in AngularJS Custom Directive?" style="display: block; margin-bottom: 10px; clear: both; max-width: 100%;" decoding="async" fetchpriority="high" srcset="https://jharaphula.com/wp-content/uploads/2018/02/Restrict-a-Custom-Directive-300x192.png 300w, https://jharaphula.com/wp-content/uploads/2018/02/Restrict-a-Custom-Directive.png 610w" sizes="(max-width: 300px) 100vw, 300px" /><p>Among several advanced features of AngularJS, Directive is a major Chapter. Using Directive we can reuse our Codes like a widget. Directive comes with many...</p>
<p>The post <a href="https://jharaphula.com/restrict-option-custom-directive/">How to use restrict option in AngularJS Custom Directive?</a> appeared first on <a href="https://jharaphula.com">OneStop Shop</a>.</p>
]]></description>
										<content:encoded><![CDATA[<img width="300" height="192" src="https://jharaphula.com/wp-content/uploads/2018/02/Restrict-a-Custom-Directive-300x192.png" class="webfeedsFeaturedVisual wp-post-image" alt="How to use restrict option in AngularJS Custom Directive?" style="display: block; margin-bottom: 10px; clear: both; max-width: 100%;" decoding="async" srcset="https://jharaphula.com/wp-content/uploads/2018/02/Restrict-a-Custom-Directive-300x192.png 300w, https://jharaphula.com/wp-content/uploads/2018/02/Restrict-a-Custom-Directive.png 610w" sizes="(max-width: 300px) 100vw, 300px" /><p>Among several advanced features of <a href="https://angularjs.org/" rel="noopener noreferrer nofollow" target="_blank">AngularJS</a>, Directive is a major Chapter. Using Directive we can reuse our Codes like a widget. Directive comes with many Directive Definition Objects (DDO). From them restrict is one. Using restrict option inside a Custom Directive we can prevent the access level of Directive for Element(E), Attribute(A), Comment(M) or Class(C).</p>
<p>For an example if you want to use your Custom Directive only like a element in view (<em>&lt;elem-attr-directive&gt;&lt;/elem-attr-directive&gt;</em>) then while creating the Directive pass the restrict option E (<em>restrict: &#8220;E&#8221;</em>). Similarly if you want to restrict the use of directive like an Attribute then you  can pass A in place of E or else if you want your directive to be used like an element or attribute you can pass AE together (<em>restrict: &#8220;AE&#8221;</em>).</p>
<p>To make your vision clear in below I am sharing an example using restrict option inside Custom Directives. In this demo app I created 3 Custom Directives. The first one is restricted to use like Element or Attribute. The second one “customColor” directive is restricted to use like Class and the third one “commentDirective” is a directive to use during Comments.</p>
<p>Notice Carefully, depending upon the restrict option, structure of each directive is different. The first on “elemAttrDirective” is restricted to use like an Element or Attribute. The cause it&#8217;s having template option. Using template here I am showing a line of text followed by H1 tag. Where in my second directive “customColor” I am finding the HTML Elements from DOM using link function and then applying <a href="https://jharaphula.com/css3-new-features-gradients-webfonts/" rel="noopener noreferrer" target="_blank">CSS</a> Style as this directive is restricted to use like a Class. Similarly in “commentDirective” I am using template and replace option to rewrite the Comment while using in view. Make a note while using a directive which is restricted to use in Comment block you have to put you directive name followed by “directive:”.</p>
<h3>Using restrict option in AngularJS Custom Directive</h3>
<pre class="brush: xml; title: ; notranslate">&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;
&lt;script src=&quot;https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular.min.js&quot;&gt;&lt;/script&gt;
&lt;/head&gt;

&lt;body ng-app=&quot;DemoApp&quot;&gt;

&lt;!-- In view of using restrict option for Element(E) --&gt;
&lt;elem-attr-directive&gt;&lt;/elem-attr-directive&gt;

&lt;!-- In view of using restrict option for Attribute(A) --&gt;
&lt;div elem-attr-directive&gt;&lt;/div&gt;

&lt;!-- In view of using restrict option for CSS Class(C) --&gt;
&lt;div class=&quot;custom-color&quot;&gt;This is a Class based Custom Directive in AngularJS&lt;/div&gt;

&lt;!-- In view of using restrict option for Comment(M) --&gt;
&lt;!-- directive:comment-directive --&gt;

&lt;script&gt;
var DemoApp = angular.module(&quot;DemoApp&quot;, []);

/* Always declaring directive name using Camel Case */
DemoApp.directive(&quot;elemAttrDirective&quot;, function() {
return {
restrict: &quot;AE&quot;,
template: &quot;&lt;h1&gt;This line is from Directive using restrict option AE.&lt;/h1&gt;&quot;
};
});

DemoApp.directive(&quot;customColor&quot;, function() {
return {
restrict: &quot;C&quot;,
link: function(scope, element, attrs) {
element.css(&quot;color&quot;, &quot;#FF0000&quot;);
}
}
});

DemoApp.directive('commentDirective', function() {
return {
restrict: 'M',
replace: true,
template: '&lt;div&gt;This line is from &quot;commentDirective&quot; Custom Directive.&lt;/div&gt;'
};
});
&lt;/script&gt;

&lt;/body&gt;
&lt;/html&gt;</pre>
<p>The post <a href="https://jharaphula.com/restrict-option-custom-directive/">How to use restrict option in AngularJS Custom Directive?</a> appeared first on <a href="https://jharaphula.com">OneStop Shop</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://jharaphula.com/restrict-option-custom-directive/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			<media:content url="https://jharaphula.com/wp-content/uploads/2018/02/Restrict-a-Custom-Directive.png" medium="image" />
	</item>
		<item>
		<title>Example to Call Webservice inside AngularJS Controller</title>
		<link>https://jharaphula.com/example-to-call-webservice-angularjs/</link>
					<comments>https://jharaphula.com/example-to-call-webservice-angularjs/#respond</comments>
		
		<dc:creator><![CDATA[Nibedita Panda]]></dc:creator>
		<pubDate>Sun, 15 May 2016 16:52:26 +0000</pubDate>
				<category><![CDATA[AngularJS with Examples]]></category>
		<category><![CDATA[Ajax using Angular]]></category>
		<category><![CDATA[AngularJS]]></category>
		<category><![CDATA[Example to Call Webservice]]></category>
		<category><![CDATA[Webservice]]></category>
		<category><![CDATA[Webservice inside Controller]]></category>
		<guid isPermaLink="false">http://box.jharaphula.com/?p=1622</guid>

					<description><![CDATA[<img width="300" height="201" src="https://jharaphula.com/wp-content/uploads/2016/05/web-services.gif" class="webfeedsFeaturedVisual wp-post-image" alt="Example to Call Webservice inside AngularJS Controller" style="display: block; margin-bottom: 10px; clear: both; max-width: 100%;" decoding="async" /><p>Webservice is nothing but the technique using which we can sale functionalities over web. Let&#8217;s talk about an Income Tax calculator. It is useful for...</p>
<p>The post <a href="https://jharaphula.com/example-to-call-webservice-angularjs/">Example to Call Webservice inside AngularJS Controller</a> appeared first on <a href="https://jharaphula.com">OneStop Shop</a>.</p>
]]></description>
										<content:encoded><![CDATA[<img width="300" height="201" src="https://jharaphula.com/wp-content/uploads/2016/05/web-services.gif" class="webfeedsFeaturedVisual wp-post-image" alt="Example to Call Webservice inside AngularJS Controller" style="display: block; margin-bottom: 10px; clear: both; max-width: 100%;" decoding="async" loading="lazy" /><p>Webservice is nothing but the technique using which we can sale functionalities over web. Let&#8217;s talk about an Income Tax calculator. It is useful for many employees, organizations and banks. If we are developing the calculator repeatedly form different different organizations, it is nothing but the loss of productivity. How it is if we can use same service from a global space. This is what web service do. Webservice returns data in form of XML or <a href="https://jharaphula.com/learn-json-tutorial-for-beginners/" target="_blank" rel="noopener noreferrer">JSON</a>. In the below example look how to call Webservice inside AngularJS Controller.</p>
<p>booksController is the name of my Controller. Inside this I am executing $http.get() method. On Success which returns a response. To access response data from view I am assigning those data to $scope.data object. Inside html body using ng-repeat I am displaying authors name from Webservice.</p>
<h3>Example-to-Call-Webservice.htm</h3>
<pre class="brush: xml; title: ; notranslate">&lt;html ng-app=&quot;booksInvApp&quot;&gt;
&lt;head&gt;
&lt;title&gt;Example to Call Webservice in AngularJS&lt;/title&gt;
&lt;script src=&quot;https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
var app = angular.module('booksInvApp', []);
app.controller('booksController', function($scope, $http) {
$http.get(&quot;https://whispering-woodland-9020.herokuapp.com/getAllBooks&quot;)
.then(function(response) {
$scope.data = response.data;
});
});
&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;div ng-controller=&quot;booksController&quot;&gt;
&lt;h3 ng-repeat=&quot;bookDetails in data.books&quot;&gt;{{bookDetails.author}}&lt;/h3&gt;    
&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>
<p>The post <a href="https://jharaphula.com/example-to-call-webservice-angularjs/">Example to Call Webservice inside AngularJS Controller</a> appeared first on <a href="https://jharaphula.com">OneStop Shop</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://jharaphula.com/example-to-call-webservice-angularjs/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			<media:content url="https://jharaphula.com/wp-content/uploads/2016/05/web-services.gif" medium="image" />
	</item>
		<item>
		<title>Angularjs $watch and Link Function Example to fetch value from View</title>
		<link>https://jharaphula.com/angularjs-watch-link-function-example/</link>
					<comments>https://jharaphula.com/angularjs-watch-link-function-example/#respond</comments>
		
		<dc:creator><![CDATA[Nibedita Panda]]></dc:creator>
		<pubDate>Sun, 15 May 2016 16:30:09 +0000</pubDate>
				<category><![CDATA[AngularJS with Examples]]></category>
		<category><![CDATA[AngularJS]]></category>
		<category><![CDATA[JavaScript Function]]></category>
		<category><![CDATA[Link Function Example]]></category>
		<guid isPermaLink="false">http://box.jharaphula.com/?p=1610</guid>

					<description><![CDATA[<img width="300" height="185" src="https://jharaphula.com/wp-content/uploads/2016/05/angularjs-watch-method-300x185.png" class="webfeedsFeaturedVisual wp-post-image" alt="Angularjs $watch and Link Function Example to fetch value from View" style="display: block; margin-bottom: 10px; clear: both; max-width: 100%;" decoding="async" loading="lazy" srcset="https://jharaphula.com/wp-content/uploads/2016/05/angularjs-watch-method-300x185.png 300w, https://jharaphula.com/wp-content/uploads/2016/05/angularjs-watch-method.png 750w" sizes="auto, (max-width: 300px) 100vw, 300px" /><p>During you Create Dynamic Directives in AngularJS $watch method helps to Fetch value from View. In this example I am Creating a Dynamic Tab. The...</p>
<p>The post <a href="https://jharaphula.com/angularjs-watch-link-function-example/">Angularjs $watch and Link Function Example to fetch value from View</a> appeared first on <a href="https://jharaphula.com">OneStop Shop</a>.</p>
]]></description>
										<content:encoded><![CDATA[<img width="300" height="185" src="https://jharaphula.com/wp-content/uploads/2016/05/angularjs-watch-method-300x185.png" class="webfeedsFeaturedVisual wp-post-image" alt="Angularjs $watch and Link Function Example to fetch value from View" style="display: block; margin-bottom: 10px; clear: both; max-width: 100%;" decoding="async" loading="lazy" srcset="https://jharaphula.com/wp-content/uploads/2016/05/angularjs-watch-method-300x185.png 300w, https://jharaphula.com/wp-content/uploads/2016/05/angularjs-watch-method.png 750w" sizes="auto, (max-width: 300px) 100vw, 300px" /><p>During you Create Dynamic Directives in AngularJS $watch method helps to Fetch value from View. In this example I am <a href="https://jharaphula.com/example-angularjs-dynamic-tabs-bootstrap/" target="_blank" rel="noopener noreferrer">Creating a Dynamic Tab</a>. The directive I named ng-tab. While declaring my directive in HTML body I am passing 2 things length and data. Data is nothing but the tab names in the shape of state and its cities. Now just you think how can we get these values in AngularJS Controller. The same $watch method do.</p>
<p>Look at my app.js file. In scope I am taking length &amp; data as the key. Then in link function fetching those values using $watch method. The key thing you will notice the length is accepting &#8216;=&#8217; when data is accepting &#8216;@&#8217;. This because of Data types. Generally for integer we take &#8216;=&#8217; and &#8216;@&#8217; for string characters.</p>
<h3>Index.htm</h3>
<pre class="brush: xml; title: ; notranslate">&lt;!DOCTYPE html&gt;
&lt;html ng-app=&quot;tabModule&quot;&gt;
&lt;head&gt;
&lt;meta charset=&quot;utf-8&quot;&gt;
&lt;title&gt;Angularjs $watch and Link Function Example&lt;/title&gt;
&lt;!--AngularJS library CDN link--&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;https://ajax.googleapis.com/ajax/libs/angularjs/1.3.0-rc.0/angular.min.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;app.js&quot;&gt;&lt;/script&gt;
&lt;!--Jquery library CDN link--&gt;
&lt;script src=&quot;http://code.jquery.com/jquery-1.11.0.min.js&quot;&gt;&lt;/script&gt;
&lt;!--Jquery UI CDN link--&gt;
&lt;script src=&quot;http://code.jquery.com/ui/1.11.1/jquery-ui.js&quot;&gt;&lt;/script&gt;
&lt;!--BootStrap CDN links--&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;http://netdna.bootstrapcdn.com/twitter-bootstrap/2.1.1/js/bootstrap.js&quot;&gt;&lt;/script&gt;
&lt;link href=&quot;http://netdna.bootstrapcdn.com/twitter-bootstrap/2.1.1/css/bootstrap.no-icons.min.css&quot; rel=&quot;stylesheet&quot;&gt;
&lt;link href=&quot;http://netdna.bootstrapcdn.com/font-awesome/2.0/css/font-awesome.css&quot; rel=&quot;stylesheet&quot;&gt;
&lt;link rel=&quot;stylesheet&quot; href=&quot;http://netdna.bootstrapcdn.com/twitter-bootstrap/2.1.1/css/bootstrap.min.css&quot; type=&quot;text/css&quot;&gt;
&lt;link rel=&quot;stylesheet&quot; href=&quot;http://netdna.bootstrapcdn.com/twitter-bootstrap/2.1.1/css/bootstrap-theme.min.css&quot; type=&quot;text/css&quot;&gt;
&lt;link rel=&quot;stylesheet&quot; href=&quot;http://code.jquery.com/ui/1.11.1/themes/smoothness/jquery-ui.css&quot;&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;ng-tab length=&quot;4&quot; data='{&quot;Country&quot;:[{&quot;state&quot;:&quot;Maharashtra&quot;, &quot;cities&quot;:&quot;Mumbai, Pune, Nagpur, Thane, Nashik&quot;},{&quot;state&quot;:&quot;Odisha&quot;, &quot;cities&quot;:&quot;Bhubaneswar, Cuttack, Rourkela, Brahmapur, Sambalpur&quot;},{&quot;state&quot;:&quot;Karnataka&quot;, &quot;cities&quot;:&quot;Bellary, Bidar, Gulbarga, Koppal, Raichur&quot;},{&quot;state&quot;:&quot;Chandigarh&quot;, &quot;cities&quot;:&quot;Ludhiana, Amritsar, Jalandhar, Patiala, Bathinda&quot;}]}'&gt;&lt;/ng-tab&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>
<h3>my-tab.htm</h3>
<pre class="brush: xml; title: ; notranslate">&lt;!--ngTab Template--&gt;
&lt;h3&gt;&lt;center&gt;{{ appDetails }}&lt;/center&gt;&lt;/h3&gt;
&lt;div class=&quot;container&quot;&gt;
&lt;div id=&quot;content&quot;&gt;
&lt;ul id=&quot;tabs&quot; class=&quot;nav nav-tabs&quot; data-tabs=&quot;tabs&quot;&gt;
&lt;li ng-class=&quot;{active: $first}&quot; ng-repeat=&quot;item in tempArrTab&quot;&gt;
&lt;a href=&quot;#{{ item }}&quot; data-toggle=&quot;tab&quot;&gt;{{ item }}&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;div id=&quot;my-tab-content&quot; class=&quot;tab-content&quot;&gt;
&lt;div ng-repeat=&quot;item in tempArrTab&quot; class=&quot;tab-pane&quot; ng-class=&quot;{active: $first}&quot; id=&quot;{{ item }}&quot;&gt;
&lt;h2&gt;{{ item }}&lt;/h2&gt;
&lt;p&gt;Welcome to {{ item }}. Visit Us.&lt;/p&gt;
Cities : &lt;input list=&quot;tags-{{ $index }}&quot;&gt;
&lt;/div&gt;

&lt;div ng-repeat=&quot;compitem in tempCompArr&quot;&gt;
&lt;datalist id=&quot;tags-{{ $index }}&quot;&gt;
&lt;option ng-repeat=&quot;items in compitem.split(',')&quot; value=&quot;{{ items }}&quot;&gt;
&lt;/datalist&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;</pre>
<h3>app.js</h3>
<pre class="brush: jscript; title: ; notranslate">/* ng-tab Module */
angular.module('tabModule', []).directive('ngTab', function() {
return {
restrict: 'E',
transclude: true,

scope: {
/* Accepting the number of Tab you want in your app */
&quot;length&quot;: '=',
/* Accepting the data in JSON for Tab */
&quot;data&quot;: '@'
},

link: function (scope, element) {
scope.$watch(&quot;length&quot;, function (arrlen) {
scope.$watch(&quot;data&quot;, function (value) {

var obj = JSON.parse(value);

var lenjson = obj.Country.length;

var arrTab = [];
var autoCompArray = [];

/* Assigning input JSON data to Array */
if (arrlen == lenjson) {
for(i=0; i&amp;lt;lenjson; i++) {
arrTab.push(obj.Country[i].state);
autoCompArray.push(obj.Country[i].cities)
}
} else {
alert('Please provide accurate data length.');
}

scope.tempArrTab = arrTab;
scope.tempCompArr = autoCompArray;
scope.appDetails = 'Create your own ng-tab using AngularJS';

}, false);

}, false);
},

controller: function($scope, $filter) {

$(function() {
$(&quot;#tabs&quot;).tabs();
});
},
templateUrl: 'my-tab.htm'
};
});</pre>
<p>The post <a href="https://jharaphula.com/angularjs-watch-link-function-example/">Angularjs $watch and Link Function Example to fetch value from View</a> appeared first on <a href="https://jharaphula.com">OneStop Shop</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://jharaphula.com/angularjs-watch-link-function-example/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			<media:content url="https://jharaphula.com/wp-content/uploads/2016/05/angularjs-watch-method.png" medium="image" />
	</item>
		<item>
		<title>How to implement MVC Architecture in AngularJS?</title>
		<link>https://jharaphula.com/mvc-architecture-angularjs/</link>
					<comments>https://jharaphula.com/mvc-architecture-angularjs/#respond</comments>
		
		<dc:creator><![CDATA[Biswabhusan Panda]]></dc:creator>
		<pubDate>Sun, 15 May 2016 15:36:41 +0000</pubDate>
				<category><![CDATA[AngularJS with Examples]]></category>
		<category><![CDATA[AngularJS Library]]></category>
		<category><![CDATA[MVC Architecture]]></category>
		<category><![CDATA[MVC Architecture in Angular]]></category>
		<category><![CDATA[MVVM]]></category>
		<category><![CDATA[MVW]]></category>
		<guid isPermaLink="false">http://box.jharaphula.com/?p=1595</guid>

					<description><![CDATA[<img width="300" height="191" src="https://jharaphula.com/wp-content/uploads/2016/05/AngularJS-Training-300x191.jpg" class="webfeedsFeaturedVisual wp-post-image" alt="How to implement MVC Architecture in AngularJS?" style="display: block; margin-bottom: 10px; clear: both; max-width: 100%;" decoding="async" loading="lazy" srcset="https://jharaphula.com/wp-content/uploads/2016/05/AngularJS-Training-300x191.jpg 300w, https://jharaphula.com/wp-content/uploads/2016/05/AngularJS-Training.jpg 750w" sizes="auto, (max-width: 300px) 100vw, 300px" /><p>AngularJS was developed and maintained by Google. As a latest Technology AngularJS comes with many Advanced features. Depending upon its feature rich functionalities today it...</p>
<p>The post <a href="https://jharaphula.com/mvc-architecture-angularjs/">How to implement MVC Architecture in AngularJS?</a> appeared first on <a href="https://jharaphula.com">OneStop Shop</a>.</p>
]]></description>
										<content:encoded><![CDATA[<img width="300" height="191" src="https://jharaphula.com/wp-content/uploads/2016/05/AngularJS-Training-300x191.jpg" class="webfeedsFeaturedVisual wp-post-image" alt="How to implement MVC Architecture in AngularJS?" style="display: block; margin-bottom: 10px; clear: both; max-width: 100%;" decoding="async" loading="lazy" srcset="https://jharaphula.com/wp-content/uploads/2016/05/AngularJS-Training-300x191.jpg 300w, https://jharaphula.com/wp-content/uploads/2016/05/AngularJS-Training.jpg 750w" sizes="auto, (max-width: 300px) 100vw, 300px" /><p>AngularJS was developed and maintained by Google. As a latest Technology AngularJS comes with many Advanced features. Depending upon its feature rich functionalities today it is one of the most popular JS Framework. It Supports MVVM, MVW and MVC Architecture. Among these Architectures MVC is the most popular one. Before Discuss more into MVC Architecture using <a href="https://jharaphula.com/beginners-learn-angularjs-with-examples/" target="_blank" rel="noopener noreferrer">AngularJS</a> let us Start with what is design pattern. Design pattern is nothing but a structural approach to develop quality codes. Design pattern improves Code reuse-ability.</p>
<p><strong>Model</strong> &#8211; Model is the layer using which we design data inside a Controller. In MVC Architecture model resides in lowest level. Let&#8217;s talk about an Employee Management System. Here we can Create various models like Employee Details, Manager Details or Salary Details. In side a controller we can create models depending upon our data requirement. Model not only helps to Organize data but also it is capable to handle business logics.</p>
<p>To represent model in view AngularJS provides $scope object. Any object assign to $scope it is accessible in view. Look at the below Example of model. Here I am storing some string value to a variable under $Scope object.</p>
<pre class="brush: jscript; title: ; notranslate">$scope.employees =  {
'Name':'Jimmy Jose',
'Address':'New Delhi, India',
'Email':'jimmy_jose@gmail.com'
}</pre>
<p>Model was specially designed to plan structured data. Let&#8217;s take one more example where you want to show list of States depending upon the on change event of a Country dropdown. In this case while creating a data model we have to go like the below example.</p>
<pre class="brush: jscript; title: ; notranslate">$scope.countries =  {
'Country':'India',
'States': { 'Utar Pradesh', 'Andra Pradesh', 'Odhisha', 'Karnatak', 'New Delhi' }
}</pre>
<p><strong>View</strong> &#8211; View is nothing but what user watch. I mean the rendered HTML. AngularJS makes HTML enrich. In Controller AngularJS provides a $scope object. Which is responsible to inter-exchange data in between View and Controller. To display Controller data in view generally we use the following Syntax.</p>
<pre class="brush: xml; title: ; notranslate">{{ variable from Controller }}</pre>
<p><strong>Controller</strong> &#8211; Controller is the unit which Controls application logic. Whether we do an operation in a variable or implement a function Controller handles all that. Controller receives input from view, validates it and performs business operations that modify the state of the data model. To create Controller in AngularJS we use the following Syntax.</p>
<pre class="brush: jscript; title: ; notranslate">CusFilterMod.controller('CusFilterCtrl', ['$scope', '$filter', function($scope, $filter)  ...... });</pre>
<h3>Example of MVC Architecture in AngularJS</h3>
<pre class="brush: xml; title: ; notranslate">&lt;html ng-app=&quot;myModel&quot;&gt;
&lt;head&gt;
&lt;title&gt;Example to implement MVC Design Pattern using AngularJS&lt;/title&gt;
&lt;script SRC=&quot;https://ajax.googleapis.com/ajax/libs/angularjs/1.2.13/angular.js&quot;&gt;
&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
var app = angular.module('myModel', []);
/*Creating Controller Here*/
app.controller('myController', function($scope) {
/*Creating Model Here*/
$scope.employees =  {
'Name':'Jimmy Jose',
'Address':'New Delhi, India',
'Email':'jimi_jose@gmail.com'
}
});
&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;p&gt;Displing model data in view through controller&lt;/p&gt;
&lt;div ng-controller=&quot;myController&quot;&gt;
&lt;h3&gt;{{ employees.Name }} &lt;/h3&gt;
&lt;h3&gt;{{ employees.Address }} &lt;/h3&gt;
&lt;h3&gt;{{ employees.Email }} &lt;/h3&gt;
&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>
<p>The post <a href="https://jharaphula.com/mvc-architecture-angularjs/">How to implement MVC Architecture in AngularJS?</a> appeared first on <a href="https://jharaphula.com">OneStop Shop</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://jharaphula.com/mvc-architecture-angularjs/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			<media:content url="https://jharaphula.com/wp-content/uploads/2016/05/AngularJS-Training.jpg" medium="image" />
	</item>
		<item>
		<title>How to restrict AngularJS Search Filter to a Specific Column?</title>
		<link>https://jharaphula.com/restrict-angularjs-search-filter/</link>
					<comments>https://jharaphula.com/restrict-angularjs-search-filter/#respond</comments>
		
		<dc:creator><![CDATA[Biswabhusan Panda]]></dc:creator>
		<pubDate>Sun, 15 May 2016 15:29:37 +0000</pubDate>
				<category><![CDATA[AngularJS with Examples]]></category>
		<category><![CDATA[AngularJS Search Filter]]></category>
		<category><![CDATA[Filter to a Specific Column]]></category>
		<category><![CDATA[Filter to Reverse a String]]></category>
		<category><![CDATA[Search Filter in the Column Header]]></category>
		<guid isPermaLink="false">http://box.jharaphula.com/?p=1589</guid>

					<description><![CDATA[<img width="300" height="181" src="https://jharaphula.com/wp-content/uploads/2016/05/search-using-angularjs-300x181.jpg" class="webfeedsFeaturedVisual wp-post-image" alt="How to restrict AngularJS Search Filter to a Specific Column?" style="display: block; margin-bottom: 10px; clear: both; max-width: 100%;" decoding="async" loading="lazy" srcset="https://jharaphula.com/wp-content/uploads/2016/05/search-using-angularjs-300x181.jpg 300w, https://jharaphula.com/wp-content/uploads/2016/05/search-using-angularjs.jpg 750w" sizes="auto, (max-width: 300px) 100vw, 300px" /><p>Among many Advanced features of AngularJS Search Filter is One. Like JavaScript we don&#8217;t required to write a Search function. Simply by using the Keyword...</p>
<p>The post <a href="https://jharaphula.com/restrict-angularjs-search-filter/">How to restrict AngularJS Search Filter to a Specific Column?</a> appeared first on <a href="https://jharaphula.com">OneStop Shop</a>.</p>
]]></description>
										<content:encoded><![CDATA[<img width="300" height="181" src="https://jharaphula.com/wp-content/uploads/2016/05/search-using-angularjs-300x181.jpg" class="webfeedsFeaturedVisual wp-post-image" alt="How to restrict AngularJS Search Filter to a Specific Column?" style="display: block; margin-bottom: 10px; clear: both; max-width: 100%;" decoding="async" loading="lazy" srcset="https://jharaphula.com/wp-content/uploads/2016/05/search-using-angularjs-300x181.jpg 300w, https://jharaphula.com/wp-content/uploads/2016/05/search-using-angularjs.jpg 750w" sizes="auto, (max-width: 300px) 100vw, 300px" /><p>Among many Advanced features of <a href="https://angularjs.org/" rel="noopener noreferrer nofollow" target="_blank">AngularJS</a> Search Filter is One. Like JavaScript we don&#8217;t required to write a Search function. Simply by using the Keyword Filter with directives we can implement Search option in AngularJS.</p>
<p>Look at the below Example. Here I have <a href="https://jharaphula.com/learn-json-tutorial-for-beginners/" target="_blank" rel="noopener noreferrer">JSON</a> formatted data in employees object of $scope. For each employee record there are 5 columns name, dob, designation, gender &amp; salary. What I want is when I will search using a input box I need to filer records depending upon employees names only.</p>
<p>To do so while binding data using ng-repeat I am using &#8220;employee in employees | filter:{name:search}&#8221;. By default filter keyword search all the columns from employees object. To restrict Search to specific column employee name here I am passing name:search as a param to filter option.</p>
<h3>Example to restrict AngularJS Search Option</h3>
<pre class="brush: jscript; title: ; notranslate">&lt;!DOCTYPE html&gt;
&lt;html ng-app=&quot;CusFilterMod&quot;&gt;
&lt;head&gt;
&lt;title&gt;How to restrict AngularJS Search Filter to a specific column?&lt;/title&gt;
&lt;style type=&quot;text/css&quot;&gt;
th { background: #000000; color: #ffffff; border: 1px solid grey; border-collapse: collapse; }
table, td  { border: 1px solid grey; border-collapse: collapse; padding: 5px; }
table tr:nth-child(odd)    { background-color: #f1f1f1; }
table tr:nth-child(even) { background-color: #ffffff; }
&lt;/style&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;https://ajax.googleapis.com/ajax/libs/angularjs/1.0.1/angular.min.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
var CusFilterMod = angular.module('CusFilterMod', [])
.controller('CusFilterCtrl', ['$scope', '$filter', function($scope, $filter) {
var employees = [{
name: 'Rishika Malviya',
dob: new Date(&quot;January 20, 1985&quot;),
designation: 'Project Manager',
gender: 'Female',
salary: 25000
}, {
name: 'Niraja Nayak',
dob: new Date(&quot;February 25, 1995&quot;),
designation: 'Manager',
gender: 'Male',
salary: 45000
}, {
name: 'Biswabhusan Panda',
dob: new Date(&quot;December 12, 1970&quot;),
designation: 'Team Leader',
gender: 'Male',
salary: 25500
}, {
name: 'Ravi Sakalkar',
dob: new Date(&quot;October 1, 1985&quot;),
designation: 'Business Head',
gender: 'Female',
salary: 55000
},
{
name: 'Punam Nikam',
dob: new Date(&quot;November 10, 1955&quot;),
designation: 'Graphics Designer',
gender: 'Male',
salary: 75000
}
];
$scope.employees = employees;
}]);
&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;div ng-controller=&quot;CusFilterCtrl&quot;&gt;
Search &lt;input type=&quot;text&quot; ng-model=&quot;search&quot; placeholder=&quot;Search Employees&quot;&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;th&gt;Name&lt;/th&gt;
&lt;th&gt;Date&lt;/th&gt;
&lt;th&gt;Designation&lt;/th&gt;
&lt;th&gt;Gender&lt;/th&gt;
&lt;th&gt;Salary&lt;/th&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr ng-repeat=&quot;employee in employees | filter:{name:search}&quot;&gt;
&lt;td&gt;{{ employee.name | uppercase }}&lt;/td&gt;
&lt;td&gt;{{ employee.dob | date:&quot;MMM dd, yyyy&quot; }}&lt;/td&gt;
&lt;td&gt;{{ employee.designation }}&lt;/td&gt;
&lt;td&gt;{{ employee.gender }}&lt;/td&gt;
&lt;td&gt;{{ employee.salary | currency:&quot;$&quot;:2 }}&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>
<p>The post <a href="https://jharaphula.com/restrict-angularjs-search-filter/">How to restrict AngularJS Search Filter to a Specific Column?</a> appeared first on <a href="https://jharaphula.com">OneStop Shop</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://jharaphula.com/restrict-angularjs-search-filter/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			<media:content url="https://jharaphula.com/wp-content/uploads/2016/05/search-using-angularjs.jpg" medium="image" />
	</item>
		<item>
		<title>How to bind data to Select tag using AngularJS ng-options?</title>
		<link>https://jharaphula.com/select-control-angularjs-ng-options/</link>
					<comments>https://jharaphula.com/select-control-angularjs-ng-options/#respond</comments>
		
		<dc:creator><![CDATA[Biswabhusan Panda]]></dc:creator>
		<pubDate>Sun, 15 May 2016 15:28:08 +0000</pubDate>
				<category><![CDATA[AngularJS with Examples]]></category>
		<category><![CDATA[AngularJS ng-options]]></category>
		<category><![CDATA[How to Bind Data?]]></category>
		<category><![CDATA[JavaScript Programming]]></category>
		<category><![CDATA[Tag using AngularJS]]></category>
		<guid isPermaLink="false">http://box.jharaphula.com/?p=1587</guid>

					<description><![CDATA[<img width="300" height="186" src="https://jharaphula.com/wp-content/uploads/2016/05/angularjs-tab-300x186.png" class="webfeedsFeaturedVisual wp-post-image" alt="How to bind data to Select tag using AngularJS ng-options?" style="display: block; margin-bottom: 10px; clear: both; max-width: 100%;" decoding="async" loading="lazy" srcset="https://jharaphula.com/wp-content/uploads/2016/05/angularjs-tab-300x186.png 300w, https://jharaphula.com/wp-content/uploads/2016/05/angularjs-tab.png 750w" sizes="auto, (max-width: 300px) 100vw, 300px" /><p>While Developing a Web App, its a very common behavior to display list of values in a Select tag. Let&#8217;s discuss about an Employee Management...</p>
<p>The post <a href="https://jharaphula.com/select-control-angularjs-ng-options/">How to bind data to Select tag using AngularJS ng-options?</a> appeared first on <a href="https://jharaphula.com">OneStop Shop</a>.</p>
]]></description>
										<content:encoded><![CDATA[<img width="300" height="186" src="https://jharaphula.com/wp-content/uploads/2016/05/angularjs-tab-300x186.png" class="webfeedsFeaturedVisual wp-post-image" alt="How to bind data to Select tag using AngularJS ng-options?" style="display: block; margin-bottom: 10px; clear: both; max-width: 100%;" decoding="async" loading="lazy" srcset="https://jharaphula.com/wp-content/uploads/2016/05/angularjs-tab-300x186.png 300w, https://jharaphula.com/wp-content/uploads/2016/05/angularjs-tab.png 750w" sizes="auto, (max-width: 300px) 100vw, 300px" /><p>While Developing a Web App, its a very common behavior to display list of values in a Select tag. Let&#8217;s discuss about an Employee Management System where many times we required to display employee names in a dropdownlist. Assume we have a JSON file which contains employee details &amp; the application architecture is with <a href="https://jharaphula.com/category/programming-solutions/learn-angularjs-with-examples/" target="_blank" rel="noopener noreferrer">AngularJS</a>. Look at the below example here I am binding JSON formatted data from scope object using AngularJS ng-options.</p>
<p>To show list of employee names here I added for loop inside ng-options &#8220;emp.name for emp in empDetails&#8221;. Here empDetails is the object which holds JSON formatted data. Due to security reason outside the scope we can&#8217;t modify scope data directly. The reason I am cloning empDetails data to emp object inside ng-options. Then using embedded for loop binding emp.name.</p>
<h3>Using AngularJS ng-options</h3>
<pre class="brush: xml; title: ; notranslate">&lt;!DOCTYPE html&gt;
&lt;html ng-app=&quot;EmployeeMod&quot;&gt;
&lt;head&gt;
&lt;title&gt;How to bind data to Select Control using ng-options?&lt;/title&gt;
&lt;script src=&quot;https://ajax.googleapis.com/ajax/libs/angularjs/1.0.1/angular.min.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
/*Declaring the Module*/
var EmployeeMod = angular.module('EmployeeMod', []);
EmployeeMod.controller('EmployeeCtrl', function ($scope) {
/*Declaring JSON formatted Data*/
$scope.empDetails = [
{name:'Rupak Roy', designation:'Assistant Manager'},
{name:'Sujata Malhotra', designation:'Project Manager', notAnOption: true},
{name:'Raghav Setthy', designation:'Team Leader'},
{name:'Mohini Sharma', designation:'Graphics Designer', notAnOption: true},
{name:'Sanjarekha Dash', designation:'Software Engineer', notAnOption: false}
];
});
&lt;/script&gt;
&lt;/head&gt;
&lt;body ng-controller=&quot;EmployeeCtrl&quot;&gt;
&lt;!--Binding Data using ng-options--&gt;
&lt;select ng-model=&quot;empName&quot; ng-options=&quot;emp.name for emp in empDetails&quot;&gt;&lt;/select&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>
<p>The post <a href="https://jharaphula.com/select-control-angularjs-ng-options/">How to bind data to Select tag using AngularJS ng-options?</a> appeared first on <a href="https://jharaphula.com">OneStop Shop</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://jharaphula.com/select-control-angularjs-ng-options/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			<media:content url="https://jharaphula.com/wp-content/uploads/2016/05/angularjs-tab.png" medium="image" />
	</item>
		<item>
		<title>AngularJS Form Validation (Required, Email, Number &#038; Date) Examples</title>
		<link>https://jharaphula.com/angularjs-form-validation-example/</link>
					<comments>https://jharaphula.com/angularjs-form-validation-example/#comments</comments>
		
		<dc:creator><![CDATA[Nibedita Panda]]></dc:creator>
		<pubDate>Sun, 15 May 2016 14:41:02 +0000</pubDate>
				<category><![CDATA[AngularJS with Examples]]></category>
		<category><![CDATA[AngularJS]]></category>
		<category><![CDATA[Form Validation]]></category>
		<category><![CDATA[Jquery Email Validation]]></category>
		<category><![CDATA[Validation Examples]]></category>
		<guid isPermaLink="false">http://box.jharaphula.com/?p=1549</guid>

					<description><![CDATA[<img width="300" height="187" src="https://jharaphula.com/wp-content/uploads/2016/05/validation-300x187.jpg" class="webfeedsFeaturedVisual wp-post-image" alt="AngularJS Form Validation (Required, Email, Number &amp; Date) Examples" style="display: block; margin-bottom: 10px; clear: both; max-width: 100%;" decoding="async" loading="lazy" srcset="https://jharaphula.com/wp-content/uploads/2016/05/validation-300x187.jpg 300w, https://jharaphula.com/wp-content/uploads/2016/05/validation.jpg 750w" sizes="auto, (max-width: 300px) 100vw, 300px" /><p>In web technology validation is used to prevent spam entries. There are various kind of form fields validations. Some of them are Required field validation,...</p>
<p>The post <a href="https://jharaphula.com/angularjs-form-validation-example/">AngularJS Form Validation (Required, Email, Number &#038; Date) Examples</a> appeared first on <a href="https://jharaphula.com">OneStop Shop</a>.</p>
]]></description>
										<content:encoded><![CDATA[<img width="300" height="187" src="https://jharaphula.com/wp-content/uploads/2016/05/validation-300x187.jpg" class="webfeedsFeaturedVisual wp-post-image" alt="AngularJS Form Validation (Required, Email, Number &amp; Date) Examples" style="display: block; margin-bottom: 10px; clear: both; max-width: 100%;" decoding="async" loading="lazy" srcset="https://jharaphula.com/wp-content/uploads/2016/05/validation-300x187.jpg 300w, https://jharaphula.com/wp-content/uploads/2016/05/validation.jpg 750w" sizes="auto, (max-width: 300px) 100vw, 300px" /><p>In web technology validation is used to prevent spam entries. There are various kind of form fields validations. Some of them are Required field validation, email validation, date field validation or number validation. In this demo app I created these 4 AngularJS Form Validation (<em>Required Field, Email, Number and Date</em>).</p>
<p>In the below app I have 4 form fields Name, Email, Contact Number &amp; Date of Birth. Name is a required field. Without Name an user is not allowed to submit the form. As an <a href="https://jharaphula.com/category/programming-solutions/learn-angularjs-with-examples/" target="_blank" rel="noopener noreferrer">advanced feature AngularJS</a> made validations easy. By simply adding a single line of code <span style="color:brown"><code>ng-show="userForm.name.$error.required"</code><br />
</span> I can easily made Name field as mandatory.</p>
<p>To valid an email here I used pattern. Validating the pattern against email entry using AngularJS ng-pattern directive. Similar thing I did for Number validation is Contact Number field. To validate Date field in the beginning of script block I declared a variable for date pattern with value YYYY-MM-DD. Using ng-pattern in date field validating the date pattern variable.</p>
<h3>AngularJS-Form-Validation.htm</h3>
<pre class="brush: xml; title: ; notranslate">&lt;!Doctype html&gt;
&lt;html lang=&quot;en&quot;&gt;
&lt;head&gt;
&lt;title&gt;AngularJS Form Validation Example&lt;/title&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;https://ajax.googleapis.com/ajax/libs/angularjs/1.5.0/angular.min.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
var validateApp=angular.module('validateAngularApp',[]);
validateApp.controller(&quot;validateAngularctrl&quot;,function($scope){
/*Page Title goes Here*/
$scope.title=&quot;Validations using AngularJS&quot;;
/*Date pattern you can update Here*/
$scope.datepattern=&quot;YYYY-MM-DD&quot;;
$scope.userRegester=function(name, email, contact, dob) {
if(name!=null || email!=null || contact!=null || dob!=null)
{
alert(&quot;Registration Successfull !!!&quot;);
}
else
{
alert(&quot;Not Successfull Please try again.&quot;);
}
}
});
&lt;/script&gt;
&lt;/head&gt;
&lt;body ng-app=&quot;validateAngularApp&quot; ng-controller=&quot;validateAngularctrl&quot;&gt;
&lt;div role=&quot;main&quot;&gt;
&lt;header&gt;
&lt;h2&gt;{{title}}&lt;/h2&gt;
&lt;/header&gt;
&lt;section&gt;
&lt;h2&gt;Registration User Form&lt;/h2&gt;
&lt;form role=&quot;form-inline&quot; name=&quot;userForm&quot; action=&quot;&quot; method=&quot;&quot; novalidate&gt;
&lt;div&gt;
&lt;label for=&quot;name&quot;&gt;Name:&lt;/label&gt;
&lt;input type=&quot;text&quot; name=&quot;name&quot; ng-model=&quot;uname&quot; placeholder=&quot;Enter your name&quot; required /&gt;
&lt;!-- show an error if this isn't filled in --&gt;
&lt;span ng-show=&quot;userForm.name.$error.required&quot; ng-style=&quot;{color:'red'}&quot;&gt;Your name is required.&lt;/span&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;label for=&quot;email&quot;&gt;Email:&lt;/label&gt;
&lt;input type=&quot;email&quot; name=&quot;email&quot; ng-model=&quot;uemail&quot; placeholder=&quot;Enter your email&quot; ng-pattern=&quot;/^[a-z]+[a-z0-9._]+@[a-z]+\.[a-z.]{2,5}$/ &quot; required/&gt;
&lt;span ng-show=&quot;userForm.email.$error.required&quot; ng-style=&quot;{color:'red'}&quot;&gt;Your email is required .&lt;/span&gt;
&lt;span ng-show=&quot;userForm.email.$error.pattern&quot; ng-style=&quot;{color:'red'}&quot;&gt;Your email should be in correct format ex abc@gmail.com .&lt;/span&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;label for=&quot;contact Number&quot;&gt;Contact Number:&lt;/label&gt;
&lt;input type=&quot;text&quot; name=&quot;contactNumber&quot; ng-model=&quot;ucontact&quot; placeholder=&quot;Enter your Contact details&quot; ng-pattern=&quot;/^[0-9]{10,10}$/&quot; ng-minlength=&quot;10&quot; ng-maxlength=&quot;10&quot; required /&gt;
&lt;span ng-show=&quot;userForm.contactNumber.$error.required&quot; ng-style=&quot;{color:'red'}&quot;&gt;Your contact is required .&lt;/span&gt;
&lt;span ng-show=&quot;userForm.contactNumber.$error.pattern&quot; ng-style=&quot;{color:'red'}&quot;&gt;Mobile should be numeric&lt;/span&gt;
&lt;span ng-show=&quot;userForm.contactNumber.$error.minlength&quot; ng-style=&quot;{color:'red'}&quot;&gt;contact number should be minimum of 10 digits .&lt;/span&gt;
&lt;span ng-show=&quot;userForm.contactNumber.$error.maxlength&quot; ng-style=&quot;{color:'red'}&quot;&gt;contact number should be maximum of 10 digits .&lt;/span&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;label for=&quot;date_of_birth&quot;&gt;Date of Birth:&lt;/label&gt;
&lt;input type=&quot;text&quot; name=&quot;dob&quot; ng-model=&quot;udob&quot; placeholder=&quot;Enter your date of birth in the format of YYYY-MM-DD&quot; ng-pattern=&quot;datepattern&quot;required /&gt;
&lt;span ng-show=&quot;userForm.dob.$error.required&quot; ng-style=&quot;{color:'red'}&quot;&gt;Your date of birth is required &lt;/span&gt;
&lt;span ng-show=&quot;userForm.dob.$error.pattern&quot; ng-style=&quot;{color:'red'}&quot;&gt;Date of Birth must be in the format of YYYY-MM-DD&lt;/span&gt;
&lt;/div&gt;
&lt;button type=&quot;submit&quot; ng-click=&quot;userRegester(e1,e2,e3,e4)&quot;&gt;Register&lt;/button&gt;
&lt;/form&gt;
&lt;/section&gt;
&lt;footer&gt;&amp;copy; All right reserved&lt;/footer&gt;
&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>
<p>The post <a href="https://jharaphula.com/angularjs-form-validation-example/">AngularJS Form Validation (Required, Email, Number &#038; Date) Examples</a> appeared first on <a href="https://jharaphula.com">OneStop Shop</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://jharaphula.com/angularjs-form-validation-example/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			<media:content url="https://jharaphula.com/wp-content/uploads/2016/05/validation.jpg" medium="image" />
	</item>
		<item>
		<title>Example of Angular Treeview using Data from a JSON File</title>
		<link>https://jharaphula.com/example-angular-treeview-json/</link>
					<comments>https://jharaphula.com/example-angular-treeview-json/#respond</comments>
		
		<dc:creator><![CDATA[Nibedita Panda]]></dc:creator>
		<pubDate>Sun, 15 May 2016 13:22:33 +0000</pubDate>
				<category><![CDATA[AngularJS with Examples]]></category>
		<category><![CDATA[Example of Angular Treeview]]></category>
		<category><![CDATA[JSON Tutorial for beginners]]></category>
		<category><![CDATA[Treeview Example]]></category>
		<category><![CDATA[Treeview using Data from a JSON File]]></category>
		<guid isPermaLink="false">http://box.jharaphula.com/?p=1518</guid>

					<description><![CDATA[<img width="300" height="174" src="https://jharaphula.com/wp-content/uploads/2016/05/treeview-using-json-records-300x174.png" class="webfeedsFeaturedVisual wp-post-image" alt="Example of Angular Treeview using data from a JSON File" style="display: block; margin-bottom: 10px; clear: both; max-width: 100%;" decoding="async" loading="lazy" srcset="https://jharaphula.com/wp-content/uploads/2016/05/treeview-using-json-records-300x174.png 300w, https://jharaphula.com/wp-content/uploads/2016/05/treeview-using-json-records.png 750w" sizes="auto, (max-width: 300px) 100vw, 300px" /><p>JSON is one of the most popular lightweight data inter-exchange platform. It is platform independent and can easily editable without using any specific tool. Simply...</p>
<p>The post <a href="https://jharaphula.com/example-angular-treeview-json/">Example of Angular Treeview using Data from a JSON File</a> appeared first on <a href="https://jharaphula.com">OneStop Shop</a>.</p>
]]></description>
										<content:encoded><![CDATA[<img width="300" height="174" src="https://jharaphula.com/wp-content/uploads/2016/05/treeview-using-json-records-300x174.png" class="webfeedsFeaturedVisual wp-post-image" alt="Example of Angular Treeview using data from a JSON File" style="display: block; margin-bottom: 10px; clear: both; max-width: 100%;" decoding="async" loading="lazy" srcset="https://jharaphula.com/wp-content/uploads/2016/05/treeview-using-json-records-300x174.png 300w, https://jharaphula.com/wp-content/uploads/2016/05/treeview-using-json-records.png 750w" sizes="auto, (max-width: 300px) 100vw, 300px" /><p>JSON is one of the most popular lightweight data inter-exchange platform. It is platform independent and can easily editable without using any specific tool. Simply using Notepad you can read or write to a JSON file. Looking into this nearly all advanced third-party components supports JSON formatted data. In this regard here I am with a demo app to show you how to create Angular Treeview using data from a JSON file. This example is very helpful for the beginners of AngularJS.</p>
<p>Look at the example below here I have a <a href="https://jharaphula.com/learn-json-tutorial-for-beginners/" target="_blank" rel="noopener noreferrer">JSON</a> file &#8220;treeview.json&#8221; which holds the required data for my Angular Treeview. As you know to design a Treeview we required formatted data. That&#8217;s why here my JSON file has two kind of data nodes &amp; sub-nodes. To display JSON data in a Treeview here I used $http module get() method to fetch data. After successful response from get() method assigning the response data to $scope object &#8220;items&#8221; array. showSubnodes() function is to display sub-nodes under respective parent node. In view to display items I am using UL LI elements. Using ng-repeat here I am looping the data &amp; binding each record to li elements. 2 UL elements I used here. One for parent nodes &amp; other one for Sub-nodes.</p>
<h2>Example of Angular Treeview using Data</h2>
<p><img loading="lazy" decoding="async" class="alignnone size-full wp-image-3511" title="Angular Treeview" src="https://jharaphula.com/wp-content/uploads/2016/05/angularjs-json-treeview.png" alt="Angular Treeview" width="750" height="270" srcset="https://jharaphula.com/wp-content/uploads/2016/05/angularjs-json-treeview.png 750w, https://jharaphula.com/wp-content/uploads/2016/05/angularjs-json-treeview-300x108.png 300w" sizes="auto, (max-width: 750px) 100vw, 750px" /></p>
<h3>index.htm</h3>
<pre class="brush: xml; title: ; notranslate">&lt;!DOCTYPE html&gt;
&lt;html ng-app=&quot;myTreeview&quot;&gt;
&lt;head&gt;
&lt;title&gt;Angular Treeview using data from a JSON File&lt;/title&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;https://ajax.googleapis.com/ajax/libs/angularjs/1.3.0-rc.0/angular.min.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
var myTreeview = angular.module('myTreeview', []);
myTreeview.controller('treeviewCtrl', function($scope, $http) {
$http.get(&quot;treeview.json&quot;).success(function (response) {
/*After Successful Response binding the JSON data to items array in Scope object*/
$scope.items = response.treedata;
});
$scope.showSubnodes = function(item){
item.active = !item.active;
};
});
&lt;/script&gt;
&lt;/head&gt;
&lt;body ng-controller=&quot;treeviewCtrl&quot;&gt;
&lt;ul&gt;
&lt;li ng-repeat=&quot;item in items&quot; ng-click=&quot;showSubnodes(item)&quot;&gt;
&lt;span&gt;{{item.node}}&lt;/span&gt;
&lt;ul&gt;
&lt;li ng-repeat=&quot;subItem in item.subnodes&quot; ng-show=&quot;item.active&quot;&gt;
&lt;span&gt;{{subItem.subnode}}&lt;/span&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>
<h2>JSON File for Angular Treeview</h2>
<pre class="brush: jscript; title: ; notranslate">{&quot;treedata&quot;:
[
{
&quot;node&quot;: &quot;Company&quot;,
&quot;subnodes&quot;: [
{&quot;subnode&quot;: &quot;About Us&quot;},
{&quot;subnode&quot;: &quot;Press Release&quot;},
{&quot;subnode&quot;: &quot;Contact Us&quot;},
{&quot;subnode&quot;: &quot;Our Blog&quot;},
{&quot;subnode&quot;: &quot;Privacy&quot;}
]
},
{
&quot;node&quot;: &quot;Services&quot;,
&quot;subnodes&quot;: [
{&quot;subnode&quot;: &quot;VOIP&quot;},
{&quot;subnode&quot;: &quot;Web Designing&quot;},
{&quot;subnode&quot;: &quot;Photo Editing&quot;},
{&quot;subnode&quot;: &quot;Audio &amp; Video Processing&quot;},
{&quot;subnode&quot;: &quot;Logo Designing&quot;}
]
},
{
&quot;node&quot;: &quot;Products&quot;,
&quot;subnodes&quot;: [
{&quot;subnode&quot;: &quot;CMS&quot;},
{&quot;subnode&quot;: &quot;Blog Posting&quot;},
{&quot;subnode&quot;: &quot;Forum Marketing&quot;},
{&quot;subnode&quot;: &quot;Template Creation&quot;}
]
}
]
}</pre>
<p>The post <a href="https://jharaphula.com/example-angular-treeview-json/">Example of Angular Treeview using Data from a JSON File</a> appeared first on <a href="https://jharaphula.com">OneStop Shop</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://jharaphula.com/example-angular-treeview-json/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			<media:content url="https://jharaphula.com/wp-content/uploads/2016/05/treeview-using-json-records.png" medium="image" />
	</item>
		<item>
		<title>AngularJS Assessment Questionnaires for Trainees to Evaluate</title>
		<link>https://jharaphula.com/angularjs-assessment-questionnaires/</link>
					<comments>https://jharaphula.com/angularjs-assessment-questionnaires/#respond</comments>
		
		<dc:creator><![CDATA[Biswabhusan Panda]]></dc:creator>
		<pubDate>Sat, 14 May 2016 18:51:07 +0000</pubDate>
				<category><![CDATA[AngularJS with Examples]]></category>
		<category><![CDATA[Ajax using Angular]]></category>
		<category><![CDATA[AngularJS]]></category>
		<category><![CDATA[AngularJS Search Filter]]></category>
		<category><![CDATA[Data Binding in Angular]]></category>
		<category><![CDATA[Single page Application]]></category>
		<guid isPermaLink="false">http://box.jharaphula.com/?p=1230</guid>

					<description><![CDATA[<img width="300" height="178" src="https://jharaphula.com/wp-content/uploads/2016/05/assesment-angularjs-300x178.jpg" class="webfeedsFeaturedVisual wp-post-image" alt="AngularJS Assessment Questionnaires for Trainees to evaluate" style="display: block; margin-bottom: 10px; clear: both; max-width: 100%;" decoding="async" loading="lazy" srcset="https://jharaphula.com/wp-content/uploads/2016/05/assesment-angularjs-300x178.jpg 300w, https://jharaphula.com/wp-content/uploads/2016/05/assesment-angularjs.jpg 750w" sizes="auto, (max-width: 300px) 100vw, 300px" /><p>As a Corporate Trainer unless until I evaluate my trainees I don&#8217;t think I did completed the Training session. Recently looking in to the growing...</p>
<p>The post <a href="https://jharaphula.com/angularjs-assessment-questionnaires/">AngularJS Assessment Questionnaires for Trainees to Evaluate</a> appeared first on <a href="https://jharaphula.com">OneStop Shop</a>.</p>
]]></description>
										<content:encoded><![CDATA[<img width="300" height="178" src="https://jharaphula.com/wp-content/uploads/2016/05/assesment-angularjs-300x178.jpg" class="webfeedsFeaturedVisual wp-post-image" alt="AngularJS Assessment Questionnaires for Trainees to evaluate" style="display: block; margin-bottom: 10px; clear: both; max-width: 100%;" decoding="async" loading="lazy" srcset="https://jharaphula.com/wp-content/uploads/2016/05/assesment-angularjs-300x178.jpg 300w, https://jharaphula.com/wp-content/uploads/2016/05/assesment-angularjs.jpg 750w" sizes="auto, (max-width: 300px) 100vw, 300px" /><p>As a Corporate Trainer unless until I evaluate my trainees I don&#8217;t think I did completed the Training session. Recently looking in to the growing demand of AngularJS I instructed to provide training on the same. Nearly 4 to 5 batches I did trained. Including all the batches there are more then 300 IT professionals. After completion of training to evaluate all those trainees whether they grab required knowledge or not I prepared the following AngularJS Assessment Questionnaires.</p>
<p>In this Set of Questions to evaluate a trainee I covered all the possible scenarios a programmer required to <a href="https://jharaphula.com/getting-started-with-angularjs-for-absolute-beginners/" target="_blank" rel="noopener noreferrer">begin with AngularJS</a>. If your training session is for intermediate level you can refer this Questionnaires for evaluation.</p>
<p>To Design the following apps please follow <a href="https://jharaphula.com/mvc-architecture-angularjs/" target="_blank" rel="noopener noreferrer">AngularJS MVC design pattern</a>.</p>
<h3>AngularJS Search Filter</h3>
<p><strong>Qus</strong>. In a HTML page below the Search box you need to display name of your 10 colleagues. While I will start search using last name of your colleague it need to display the similar records. To store names of your colleagues you can use a $scope object with JSON formatted data.</p>
<h3>Data Binding in AngularJS</h3>
<p><strong>Qus</strong>. I have a JSON file with 10 Customers details. For each Customer I have the following three fields.</p>
<p><strong>1</strong>. Customer Name<br />
<strong>2</strong>. Email<br />
<strong>3</strong>. Customer Care Number</p>
<p>What I want is I want to display all the Customers Details in a tabular form using DIV structure. To design the Customers JSON file you can use dummy data.</p>
<h3>Conditional Checking</h3>
<p><strong>Qus</strong>. In a HTML page I have two dropdown lists. First one need to show list of Country names (4 to 5 Countries max). On change of Country dropdown list I want to show respective states for that Country in the second dropdown list. Initially the default country is the first item of Country dropdown list &amp; the default values for second dropdown list are the states for default country. For better performance I want to use switch case in place of if else.</p>
<p><strong>Qus</strong>. In Controller I have a $scope object “employees” with two fields for each record “Name” &amp; “Gender”. In HTML I want show male &amp; female employees in two different lists. Use ng-show &amp; ng-hide for showing &amp; hiding the records.</p>
<h3>Validations in AngularJS</h3>
<p><strong>Qus</strong>. To register a user in my Social Media application I need to design a form which will accept Name, Email, Contact Number &amp; Date of Birth for registration. In this form Name is a mandatory field. Email must be a valid one. Contact Number filed will accept only numbers of 10 digits &amp; Date of Birth must be in the format of YYYY-MM-DD. In case user is entering invalid data I need to show proper error message without submitting the form.</p>
<h3>Single page Application</h3>
<p><strong>Qus</strong>. In a simple HTML page I have only three links Home, About Us &amp; Contact Us. During I open this HTML file Home page is the default page with a single line Welcome message (Welcome to my Blog). When I will click on About Us link it need to show me the about us page with some dummy text. Similarly while I will click on Contact Us link it need to show Contact US page with dummy Contact Information. To make bookmark easy I want all these pages URL’s are different but during I visit from one page to other I don’t want to refresh the page. Physically Home, About Us &amp; Contact us are three different HTML files. So that it is easier for me to maintain the app.</p>
<h3>Ajax using AngularJS</h3>
<p><strong>Qus</strong>. Prepare a simple telephone directory with only 2 fields “Name” &amp; “Number”. When I will submit the page it need to post the data into a php file for database operation. Provide a link in the bottom of this page. So that when I want to watch the list of members I can visit this link. You can fetch the list of members using $http get method.</p>
<h3>Directive &amp; Templates</h3>
<p><strong>Qus</strong>. In an App I have more than 100 of pages to show Tabular Data. What I need is I want a Custom Directive “my-table”. About the look n feel of the table I want the header background color dark blue &amp; header texts in white color. For better user experience implement even &amp; odd rows with light alternate colors. Table border width you can keep thin.</p>
<h3>Service &amp; Factory</h3>
<p><strong>Qus</strong>. Create a simple calculator which will have 4 functions Addition, Subtraction, Multiplication &amp; Division.</p>
<p>The post <a href="https://jharaphula.com/angularjs-assessment-questionnaires/">AngularJS Assessment Questionnaires for Trainees to Evaluate</a> appeared first on <a href="https://jharaphula.com">OneStop Shop</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://jharaphula.com/angularjs-assessment-questionnaires/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			<media:content url="https://jharaphula.com/wp-content/uploads/2016/05/assesment-angularjs.jpg" medium="image" />
	</item>
		<item>
		<title>Responsive AngularJS Image Gallery with thumbnails</title>
		<link>https://jharaphula.com/angularjs-image-gallery-thumbnails/</link>
					<comments>https://jharaphula.com/angularjs-image-gallery-thumbnails/#comments</comments>
		
		<dc:creator><![CDATA[Biswabhusan Panda]]></dc:creator>
		<pubDate>Sat, 14 May 2016 18:37:25 +0000</pubDate>
				<category><![CDATA[AngularJS with Examples]]></category>
		<category><![CDATA[AngularJS]]></category>
		<category><![CDATA[AngularJS Image Gallery]]></category>
		<category><![CDATA[Image Gallery Example]]></category>
		<category><![CDATA[Image Gallery with thumbnails]]></category>
		<guid isPermaLink="false">http://box.jharaphula.com/?p=1215</guid>

					<description><![CDATA[<img width="300" height="188" src="https://jharaphula.com/wp-content/uploads/2016/05/responsive-image-gallery-300x188.jpg" class="webfeedsFeaturedVisual wp-post-image" alt="Responsive AngularJS Image Gallery with thumbnails" style="display: block; margin-bottom: 10px; clear: both; max-width: 100%;" decoding="async" loading="lazy" srcset="https://jharaphula.com/wp-content/uploads/2016/05/responsive-image-gallery-300x188.jpg 300w, https://jharaphula.com/wp-content/uploads/2016/05/responsive-image-gallery.jpg 724w" sizes="auto, (max-width: 300px) 100vw, 300px" /><p>During I searched for a responsive AngularJS image gallery I found many third party paid components. But sorry to say my Customer wants some thing...</p>
<p>The post <a href="https://jharaphula.com/angularjs-image-gallery-thumbnails/">Responsive AngularJS Image Gallery with thumbnails</a> appeared first on <a href="https://jharaphula.com">OneStop Shop</a>.</p>
]]></description>
										<content:encoded><![CDATA[<img width="300" height="188" src="https://jharaphula.com/wp-content/uploads/2016/05/responsive-image-gallery-300x188.jpg" class="webfeedsFeaturedVisual wp-post-image" alt="Responsive AngularJS Image Gallery with thumbnails" style="display: block; margin-bottom: 10px; clear: both; max-width: 100%;" decoding="async" loading="lazy" srcset="https://jharaphula.com/wp-content/uploads/2016/05/responsive-image-gallery-300x188.jpg 300w, https://jharaphula.com/wp-content/uploads/2016/05/responsive-image-gallery.jpg 724w" sizes="auto, (max-width: 300px) 100vw, 300px" /><p>During I searched for a responsive AngularJS image gallery I found many third party paid components. But sorry to say my Customer wants some thing free. In this regard I did suggest the customer to implement a responsive image gallery with thumbnail using <a href="https://jharaphula.com/category/programming-solutions/learn-angularjs-with-examples/" target="_blank" rel="noopener noreferrer">AngularJS</a>. It is easy &amp; less time consuming. Finally, the Customer get agree to my proposal &amp; order me to develop the POC. I did that &amp; sharing the same script in below for your reference.</p>
<p>Here I have a html file &amp; in the root directory I have an images folder. Which contains all the thumbnail &amp; original images. Inside the AngularJS controller I declared a scope object imageDetails. In this object I am keeping number of images &amp; image file names. For SEO purpose here I added alt &amp; title tag for each images. To bind the images in HTML I am using ul li elements. By CSS controlling it&#8217;s responsiveness. I used as minimum styles I can. According to your mockup you can configure the classes for desire look n feel.</p>
<p>To show the popup for individual thumbnail view I am calling a function popupOriginal() in the click event of thumbnail image. Where I am passing the file name from scope imageDetails object. During popup if user will click the body area popup is getting hide. This image gallery is capable to display any number of images. To achieve more number of images you just need to add image details in scope imageDetails object. This demo app is responsive to handle any resolution.</p>
<h3>AngularJS Image Gallery Example</h3>
<pre class="brush: xml; title: ; notranslate">&lt;!DOCTYPE html&gt;
&lt;html ng-app=&quot;imgGallery&quot;&gt;
&lt;head&gt;
&lt;title&gt;Create your own AngularJS Image Gallery&lt;/title&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;https://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;http://code.jquery.com/jquery-2.1.4.min.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
var imgGalleryModule = angular.module('imgGallery', []);
imgGalleryModule.controller('imageGalleryController', function ($scope) {
/*Developed by https://jharaphula.com*/
/*Folder path where all the images are stored*/
$scope.imgFolderPath = &quot;images/&quot;;
/*Image details like File Name &amp; SEO related alt &amp; title tags for each image*/
$scope.imageDetails = [
{'thumbnail': 'image-1.png', 'realImage': 'original-image-1.png', 'alt': 'label on Mouse Over', 'title': 'label on Mouse Over'},
{'thumbnail': 'image-2.png', 'realImage': 'original-image-2.png', 'alt': 'label on Mouse Over', 'title': 'label on Mouse Over'},
{'thumbnail': 'image-3.png', 'realImage': 'original-image-3.png', 'alt': 'label on Mouse Over', 'title': 'label on Mouse Over'},
{'thumbnail': 'image-4.png', 'realImage': 'original-image-4.png', 'alt': 'label on Mouse Over', 'title': 'label on Mouse Over'},
{'thumbnail': 'image-5.png', 'realImage': 'original-image-5.png', 'alt': 'label on Mouse Over', 'title': 'label on Mouse Over'},
{'thumbnail': 'image-6.png', 'realImage': 'original-image-6.png', 'alt': 'label on Mouse Over', 'title': 'label on Mouse Over'},
{'thumbnail': 'image-7.png', 'realImage': 'original-image-7.png', 'alt': 'label on Mouse Over', 'title': 'label on Mouse Over'},
{'thumbnail': 'image-8.png', 'realImage': 'original-image-8.png', 'alt': 'label on Mouse Over', 'title': 'label on Mouse Over'},
{'thumbnail': 'image-9.png', 'realImage': 'original-image-9.png', 'alt': 'label on Mouse Over', 'title': 'label on Mouse Over'},
{'thumbnail': 'image-10.png', 'realImage': 'original-image-10.png', 'alt': 'label on Mouse Over', 'title': 'label on Mouse Over'},
{'thumbnail': 'image-11.png', 'realImage': 'original-image-11.png', 'alt': 'label on Mouse Over', 'title': 'label on Mouse Over'},
{'thumbnail': 'image-12.png', 'realImage': 'original-image-12.png', 'alt': 'label on Mouse Over', 'title': 'label on Mouse Over'}
];
/*Function to assign real image path*/
$scope.popupOriginal = function(originalImagePath) {
$(&quot;#popupDiv&quot;).show();
$(&quot;#popupDiv&quot;).html(&quot;&lt;img src='images/&quot; + originalImagePath + &quot;' /&gt;&quot;);
};
});
/*Developed by https://jharaphula.com*/
/*Closing the popup in body click*/
$(document).mouseup(function (e)
{
var container = $(&quot;#popupDiv&quot;);
if (!container.is(e.target) &amp;&amp; container.has(e.target).length === 0) {
container.hide();
}
});
&lt;/script&gt;

&lt;style type=&quot;text/css&quot;&gt;
/*Styles related to ul li elements*/
.imgGallery { text-align:center; }
.imgGallery ul { padding: 0; margin: 0; }
.imgGallery ul li { display: inline; cursor: pointer; }
.imgStyle { margin: 10px; }
/*Style related to popup window*/
#popupDiv {
display: none;
position:fixed;
top: 50%;
left: 50%;
width: 640px;
height: 400px;
margin-top: -12em;
margin-left: -20em;
border: 1px solid #ddd;
}
&lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;div class=&quot;imgGallery&quot; ng-controller=&quot;imageGalleryController&quot;&gt;
&lt;ul&gt;
&lt;li ng-repeat=&quot;image in imageDetails&quot;&gt;
&lt;img ng-click=&quot;popupOriginal(image.realImage);&quot; class=&quot;imgStyle&quot; alt=&quot;{{ image.alt }}&quot; title=&quot;{{ image.title }}&quot; src=&quot;{{ imgFolderPath }}{{ image.thumbnail }}&quot; /&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;!--Popup Div to show original Images--&gt;
&lt;div id=&quot;popupDiv&quot;&gt;&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>
<p>In this above example I used 12 sample images to show the Gallery. You can save as the below image &amp; create more 11 images with the name declared above. Just update the slide number or even you can use your images with same resolution.</p>
<p><em>image-1.png</em><br />
<img loading="lazy" decoding="async" src="https://jharaphula.com/wp-content/uploads/2016/05/image-1.png" alt="image-1" width="150" height="150" class="alignnone size-full wp-image-3460" srcset="https://jharaphula.com/wp-content/uploads/2016/05/image-1.png 150w, https://jharaphula.com/wp-content/uploads/2016/05/image-1-100x100.png 100w" sizes="auto, (max-width: 150px) 100vw, 150px" /></p>
<p><em>original-image-1.png</em><br />
<img loading="lazy" decoding="async" src="https://jharaphula.com/wp-content/uploads/2016/05/original-image-1.png" alt="original-image-1" width="640" height="400" class="alignnone size-full wp-image-3461" srcset="https://jharaphula.com/wp-content/uploads/2016/05/original-image-1.png 640w, https://jharaphula.com/wp-content/uploads/2016/05/original-image-1-300x188.png 300w" sizes="auto, (max-width: 640px) 100vw, 640px" /></p>
<p>The post <a href="https://jharaphula.com/angularjs-image-gallery-thumbnails/">Responsive AngularJS Image Gallery with thumbnails</a> appeared first on <a href="https://jharaphula.com">OneStop Shop</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://jharaphula.com/angularjs-image-gallery-thumbnails/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			<media:content url="https://jharaphula.com/wp-content/uploads/2016/05/responsive-image-gallery.jpg" medium="image" />
	</item>
		<item>
		<title>Best way for beginners to learn AngularJS with Examples</title>
		<link>https://jharaphula.com/beginners-learn-angularjs-with-examples/</link>
					<comments>https://jharaphula.com/beginners-learn-angularjs-with-examples/#respond</comments>
		
		<dc:creator><![CDATA[Biswabhusan Panda]]></dc:creator>
		<pubDate>Sat, 14 May 2016 18:26:17 +0000</pubDate>
				<category><![CDATA[AngularJS with Examples]]></category>
		<category><![CDATA[AngularJS]]></category>
		<category><![CDATA[beginners to learn AngularJS]]></category>
		<category><![CDATA[MVC in AngularJS]]></category>
		<category><![CDATA[Scope in AngularJS Controller]]></category>
		<guid isPermaLink="false">http://box.jharaphula.com/?p=1207</guid>

					<description><![CDATA[<img width="300" height="210" src="https://jharaphula.com/wp-content/uploads/2016/05/getting-started-with-angularjs-300x210.jpg" class="webfeedsFeaturedVisual wp-post-image" alt="Best way for beginners to learn AngularJS with Examples" style="display: block; margin-bottom: 10px; clear: both; max-width: 100%;" decoding="async" loading="lazy" srcset="https://jharaphula.com/wp-content/uploads/2016/05/getting-started-with-angularjs-300x210.jpg 300w, https://jharaphula.com/wp-content/uploads/2016/05/getting-started-with-angularjs.jpg 750w" sizes="auto, (max-width: 300px) 100vw, 300px" /><p>Before Getting Started with this knowledge sharing session first let me know &#8220;Are you one among them who is interested to learn AngularJS?&#8221; if so...</p>
<p>The post <a href="https://jharaphula.com/beginners-learn-angularjs-with-examples/">Best way for beginners to learn AngularJS with Examples</a> appeared first on <a href="https://jharaphula.com">OneStop Shop</a>.</p>
]]></description>
										<content:encoded><![CDATA[<img width="300" height="210" src="https://jharaphula.com/wp-content/uploads/2016/05/getting-started-with-angularjs-300x210.jpg" class="webfeedsFeaturedVisual wp-post-image" alt="Best way for beginners to learn AngularJS with Examples" style="display: block; margin-bottom: 10px; clear: both; max-width: 100%;" decoding="async" loading="lazy" srcset="https://jharaphula.com/wp-content/uploads/2016/05/getting-started-with-angularjs-300x210.jpg 300w, https://jharaphula.com/wp-content/uploads/2016/05/getting-started-with-angularjs.jpg 750w" sizes="auto, (max-width: 300px) 100vw, 300px" /><p>Before Getting Started with this knowledge sharing session first let me know &#8220;Are you one among them who is interested to learn AngularJS?&#8221; if so you are in the correct page. <strong>Here my intention is to teach you AngularJS Programming from the the scratch</strong>. AngularJS is an open source advanced JavaScript framework. It was first introduced in 2009 by two developers &#8220;<strong>Adam Abrons</strong>&#8221; &amp; &#8220;<strong>Misko Hevery</strong>&#8221; from Google. Later by looking into it&#8217;s brilliant features &amp; growing demand AngularJS is finally take over by Google. In 2012 the first version of AngularJS get released.</p>
<h3>Why AngularJS is more popular compare to other Frameworks?</h3>
<p>As a developer this question comes in to mind when many times you heard the term AngularJS. In replay I can say there are many key features AngularJS introduced compare to other Frameworks like <a href="http://emberjs.com" target="_blank" rel="nofollow noopener noreferrer">ember.js</a> or <a href="http://backbonejs.org" target="_blank" rel="noopener noreferrer nofollow">backbone.js</a> which made AngularJS so popular. I know you are a beginner to AngularJS but still let you note down the key features.</p>
<ul>
<li>AngularJS supports Single page Application Design.</li>
<li>MVC &amp; MVVM both Design pattern supported by AngularJS.</li>
<li>In-built Directives &amp; facility to create Custom Directives.</li>
<li>AngularJS Handles Dependencies.</li>
<li>AngularJS helps to extend HTML Vocabulary.</li>
<li>Parallel Development supports by AngularJS.</li>
<li>AngularJS supports JSON.</li>
<li>Two way Data binding.</li>
<li>Supporting Ajax.</li>
</ul>
<h3>Getting Started with AngularJS Programming</h3>
<p>To start your first &#8220;Hallo World!&#8221; program in AngularJS you need to download the AngularJS library from <a href="https://angularjs.org" target="_blank" rel="nofollow noopener noreferrer">https://angularjs.org</a> or even you can use AngularJS library <a href="http://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js" target="_blank" rel="nofollow noopener noreferrer">CDN link</a>. To <strong>get an idea about your first AngularJS app</strong> look at the example below.</p>
<p><strong>Example of my first AngularJS app</strong></p>
<pre class="brush: xml; title: ; notranslate">&lt;!DOCTYPE html&gt;
&lt;html ng-app=&quot;&quot;&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;http://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js&quot;&gt;&lt;/script&gt;
&lt;body&gt;
Your Name: &lt;input type=&quot;text&quot; ng-model=&quot;yourname&quot;&gt;
&lt;br /&gt;
&lt;h2&gt;Hello {{yourname}}&lt;/h2&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>
<p>In the above Example for demo purposed I used AngularJS CDN link. Do mark one thing <strong>in html tag I used an additional tag ng-app</strong>. This is an <a href="https://jharaphula.com/restrict-option-custom-directive/" target="_blank" rel="noopener noreferrer">AngularJS Directive</a>. <strong>To make the HTML know that we are using AngularJS ng-app is responsible</strong>. From this example if you will remove ng-app from html tag this app will not run. Like ng-app one more AngularJS directive ng-model which I used in body tag to display your name from input box to inside h2 tag. Similar to ng-app or ng-model AngularJS provides many useful Directives. For Beginners later in this session I will explain you some of the most used AngularJS directives. One more thing I want to tell you about our first AngularJS app is <strong>to display value in HTML AngularJS uses {{ &#8230; }} this Syntax</strong>.</p>
<h3>Model, View &amp; Controller (MVC) in AngularJS</h3>
<p>In software industry Codes are the Property. To maintain Codes well in a structured way there are several design patterns. Among them <strong>popular design patterns are MVC</strong> (Model View Controller) &amp; <strong>MVVM</strong> (Model View View Model). AngularJS Programming supports both these design patterns. For Beginners let us explorer AngularJS MVC design pattern in below.</p>
<p><strong>Model</strong></p>
<p>Model supply data to view. Always the Current states of application reflects in Model layer. While creating a model in AngularJS it can be string, number, boolean or object data type. The syntax we use is <span style="color: brown"><code>var myModule = angular.module('myApp', []);</code></span>.</p>
<p><strong>View</strong></p>
<p>View is nothing but the part user watch. To display data from the Controller we need to put AngularJS expression in view. As AngularJS supports two way data binding there is a continuous communication between view &amp; model. Where templates just pointing to View.</p>
<p><strong>Controller</strong></p>
<p>Controller is the area where we do implement application business logic. Refer to it&#8217;s name it act like a junction point between Model &amp; View. In AngularJS controllers are inside model. To create a controller we the following syntax.</p>
<pre class="brush: jscript; title: ; notranslate">var myApp = angular.module('myModel', []);
myModel.controller('myController', function($scope) {
$scope.Name = &quot;Ravi Meheta&quot;;
$scope.Email = &quot;ravi_meheta@infosys.com&quot;;
});</pre>
<p><strong>Example of AngularJS MVC Design Pattern</strong></p>
<pre class="brush: xml; title: ; notranslate">&lt;!DOCTYPE html&gt;
&lt;html ng-app=&quot;demoApp&quot;&gt;
&lt;script src= &quot;http://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js&quot;&gt;&lt;/script&gt;
&lt;body&gt;
&lt;div ng-controller=&quot;empController&quot;&gt;
Name: &lt;input type=&quot;text&quot; ng-model=&quot;name&quot;&gt;&lt;br&gt;
Email: &lt;input type=&quot;text&quot; ng-model=&quot;email&quot;&gt;&lt;br&gt;

Welcome Message: {{ welcomeMsg() }}
&lt;/div&gt;
&lt;script&gt;
var demoapp = angular.module('demoApp', []);
demoapp.controller('empController', function($scope) {
$scope.name = &quot;Ravi Meheta&quot;;
$scope.email = &quot;ravi_meheta@infosys.com&quot;;
$scope.welcomeMsg = function() {
return &quot;Welcome to &quot; + $scope.name + &quot;. Email ID you submitted is &quot; + $scope.email;
}
});
&lt;/script&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>
<p>The above Code is an example of how to implement AngularJS MVC pattern. In this example I created &#8220;demoApp&#8221; as my model, inside this I have a Controller &#8220;empController&#8221;. empController contains two objects name &amp; email of employee with a function welcomeMsg(). Now I think you got the idea how to write function in AngularJS Controller. The tricky thing here is $scope. Let us discuss about this in Details.</p>
<h3>$scope in AngularJS Controller</h3>
<p>$scope acts like a glue between controller &amp; view. I mean which property or method is a part of the $scope object that is accessible in view. In $scope object you can define JSON formatted data &amp; it can be used in view.</p>
<p>The post <a href="https://jharaphula.com/beginners-learn-angularjs-with-examples/">Best way for beginners to learn AngularJS with Examples</a> appeared first on <a href="https://jharaphula.com">OneStop Shop</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://jharaphula.com/beginners-learn-angularjs-with-examples/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			<media:content url="https://jharaphula.com/wp-content/uploads/2016/05/getting-started-with-angularjs.jpg" medium="image" />
	</item>
		<item>
		<title>How to Display JSON Data in a Table using AngularJS?</title>
		<link>https://jharaphula.com/how-to-display-json-data-table-angularjs/</link>
					<comments>https://jharaphula.com/how-to-display-json-data-table-angularjs/#respond</comments>
		
		<dc:creator><![CDATA[Biswabhusan Panda]]></dc:creator>
		<pubDate>Sat, 14 May 2016 17:25:59 +0000</pubDate>
				<category><![CDATA[AngularJS with Examples]]></category>
		<category><![CDATA[AngularJS]]></category>
		<category><![CDATA[CSS Styles]]></category>
		<category><![CDATA[How to Display JSON Data?]]></category>
		<category><![CDATA[JSON Data in a Table]]></category>
		<category><![CDATA[Table using AngularJS]]></category>
		<guid isPermaLink="false">http://box.jharaphula.com/?p=1181</guid>

					<description><![CDATA[<img width="300" height="187" src="https://jharaphula.com/wp-content/uploads/2016/05/AngularJS-binding-data-from-JSON-300x187.jpg" class="webfeedsFeaturedVisual wp-post-image" alt="How to display JSON data in a Table using AngularJS?" style="display: block; margin-bottom: 10px; clear: both; max-width: 100%;" decoding="async" loading="lazy" srcset="https://jharaphula.com/wp-content/uploads/2016/05/AngularJS-binding-data-from-JSON-300x187.jpg 300w, https://jharaphula.com/wp-content/uploads/2016/05/AngularJS-binding-data-from-JSON.jpg 750w" sizes="auto, (max-width: 300px) 100vw, 300px" /><p>JSON is a lightweight data-interchange platform. During development sometimes we required to bind JSON file data to controls. In this session I am showing how...</p>
<p>The post <a href="https://jharaphula.com/how-to-display-json-data-table-angularjs/">How to Display JSON Data in a Table using AngularJS?</a> appeared first on <a href="https://jharaphula.com">OneStop Shop</a>.</p>
]]></description>
										<content:encoded><![CDATA[<img width="300" height="187" src="https://jharaphula.com/wp-content/uploads/2016/05/AngularJS-binding-data-from-JSON-300x187.jpg" class="webfeedsFeaturedVisual wp-post-image" alt="How to display JSON data in a Table using AngularJS?" style="display: block; margin-bottom: 10px; clear: both; max-width: 100%;" decoding="async" loading="lazy" srcset="https://jharaphula.com/wp-content/uploads/2016/05/AngularJS-binding-data-from-JSON-300x187.jpg 300w, https://jharaphula.com/wp-content/uploads/2016/05/AngularJS-binding-data-from-JSON.jpg 750w" sizes="auto, (max-width: 300px) 100vw, 300px" /><p><strong>JSON is a lightweight data-interchange platform</strong>. During development sometimes we required to bind <a href="https://jharaphula.com/learn-json-tutorial-for-beginners/" target="_blank" rel="noopener noreferrer">JSON</a> file data to controls. In this session I am showing how to create a table in AngularJS using JSON data. Here I have 2 files one is AngularJS-table.htm &amp; insured.json. insured.json is the JSON file which contains data for insured members of my family. In AngularJS-table.htm file I am showing all the members name &amp; their relationship with me in tabular structure.</p>
<p>Trick I used here to bind data is so simple. Using <a href="https://jharaphula.com/angularjs-ajax-http-service/" target="_blank" rel="noopener noreferrer">AngularJS $http.get()</a> method I am fetching data from insured.json file. Over success I am getting all JSON file data in response object. Then to bind these data in HTML table I am assigning response.insureds (parent node of JSON data) to $scope.members object. In HTML I have a table which contains two rows header &amp; a dynamic row. Header I defined manually but for the next row I am <a href="https://jharaphula.com/ng-repeat-conditional-filter-angularjs/" target="_blank" rel="noopener noreferrer">using ng-repeat directive of AngularJS</a>. During execution according to the number of records ng-repeat will generate that number of rows for the table. To display this table more professional here I used CSS styles.</p>
<h3>AngularJS-table.htm</h3>
<pre class="brush: xml; title: ; notranslate">&lt;!DOCTYPE html&gt;
&lt;html ng-app=&quot;myInsured&quot;&gt;
&lt;head&gt;
&lt;title&gt;Example to display JSON data in a Table using AngularJS?&lt;/title&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;https://ajax.googleapis.com/ajax/libs/angularjs/1.3.0-rc.0/angular.min.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
var myInsured = angular.module('myInsured', []);
myInsured.controller('insuredCtrl', function($scope, $http) {
$http.get(&quot;insured.json&quot;).success(function (response) {
/*After Successfully fetch the data from JSON file assigning these data to $scope object variable*/
$scope.members = response.insureds;
});
});
&lt;/script&gt;
&lt;style type=&quot;text/css&quot;&gt;
/*Style for Table*/
table, th , td {
border: 1px solid grey;
border-collapse: collapse;
padding: 4px;
font-family: arial;
}
/*Style for Table Header*/
th {
background: darkblue;
color: white;
text-align: left;
}
/*Style for Alternate Rows*/
table tr:nth-child(odd) {
background-color: #C2EBC3;
}
table tr:nth-child(even) {
background-color: #FFFFFF;
}
&lt;/style&gt;
&lt;/head&gt;
&lt;body ng-controller=&quot;insuredCtrl&quot;&gt;
&lt;table&gt;
&lt;tr&gt;
&lt;th&gt;Name&lt;/th&gt;
&lt;th&gt;Relationship&lt;/th&gt;
&lt;/tr&gt;
&lt;tr ng-repeat=&quot;indivisual in members&quot;&gt;
&lt;td&gt;{{ indivisual.Name }}&lt;/td&gt;
&lt;td&gt;{{ indivisual.Relation }}&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>
<h3>insured.json</h3>
<pre class="brush: jscript; title: ; notranslate">{&quot;insureds&quot;:
[
{
&quot;Name&quot;: &quot;Aparmita Dash&quot;,
&quot;Relation&quot;: &quot;Spouse&quot;
},
{
&quot;Name&quot;: &quot;Angurbala Dash&quot;,
&quot;Relation&quot;: &quot;Mother&quot;
},
{
&quot;Name&quot;: &quot;Surendra Dash&quot;,
&quot;Relation&quot;: &quot;Father&quot;
},
{
&quot;Name&quot;: &quot;Nirupama Dash&quot;,
&quot;Relation&quot;: &quot;Daughter&quot;
},
{
&quot;Name&quot;: &quot;Sanjarekha Dash&quot;,
&quot;Relation&quot;: &quot;Daughter&quot;
}
]
}</pre>
<p>The post <a href="https://jharaphula.com/how-to-display-json-data-table-angularjs/">How to Display JSON Data in a Table using AngularJS?</a> appeared first on <a href="https://jharaphula.com">OneStop Shop</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://jharaphula.com/how-to-display-json-data-table-angularjs/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			<media:content url="https://jharaphula.com/wp-content/uploads/2016/05/AngularJS-binding-data-from-JSON.jpg" medium="image" />
	</item>
		<item>
		<title>Example of ng-repeat Conditional Filter to bind data in AngularJS</title>
		<link>https://jharaphula.com/ng-repeat-conditional-filter-angularjs/</link>
					<comments>https://jharaphula.com/ng-repeat-conditional-filter-angularjs/#respond</comments>
		
		<dc:creator><![CDATA[Nibedita Panda]]></dc:creator>
		<pubDate>Sat, 14 May 2016 05:58:55 +0000</pubDate>
				<category><![CDATA[AngularJS with Examples]]></category>
		<category><![CDATA[bind data in AngularJS]]></category>
		<category><![CDATA[Conditional Filter to bind data]]></category>
		<category><![CDATA[Example of ng-repeat]]></category>
		<category><![CDATA[ng-repeat Conditional Filter]]></category>
		<guid isPermaLink="false">http://box.jharaphula.com/?p=828</guid>

					<description><![CDATA[<img width="300" height="186" src="https://jharaphula.com/wp-content/uploads/2016/05/ng-repeat-in-angularjs-300x186.png" class="webfeedsFeaturedVisual wp-post-image" alt="Example of ng-repeat Conditional Filter to bind data in AngularJS" style="display: block; margin-bottom: 10px; clear: both; max-width: 100%;" decoding="async" loading="lazy" srcset="https://jharaphula.com/wp-content/uploads/2016/05/ng-repeat-in-angularjs-300x186.png 300w, https://jharaphula.com/wp-content/uploads/2016/05/ng-repeat-in-angularjs.png 750w" sizes="auto, (max-width: 300px) 100vw, 300px" /><p>In AngularJS ng-repeat is a frequently used Directive. Like a For loop this Directive works. I mean if you are looking to bind list of...</p>
<p>The post <a href="https://jharaphula.com/ng-repeat-conditional-filter-angularjs/">Example of ng-repeat Conditional Filter to bind data in AngularJS</a> appeared first on <a href="https://jharaphula.com">OneStop Shop</a>.</p>
]]></description>
										<content:encoded><![CDATA[<img width="300" height="186" src="https://jharaphula.com/wp-content/uploads/2016/05/ng-repeat-in-angularjs-300x186.png" class="webfeedsFeaturedVisual wp-post-image" alt="Example of ng-repeat Conditional Filter to bind data in AngularJS" style="display: block; margin-bottom: 10px; clear: both; max-width: 100%;" decoding="async" loading="lazy" srcset="https://jharaphula.com/wp-content/uploads/2016/05/ng-repeat-in-angularjs-300x186.png 300w, https://jharaphula.com/wp-content/uploads/2016/05/ng-repeat-in-angularjs.png 750w" sizes="auto, (max-width: 300px) 100vw, 300px" /><p>In AngularJS ng-repeat is a frequently used Directive. Like a For loop this Directive works. I mean if you are looking to bind list of records to a HTML Control this directive helps. You must noticed in many case during we binding data using iterations, many times we required to Filter them Conditionally. In such case how we can implement ng-repeat Conditional Filter we are showing this demo in below example.</p>
<p>Here I Created a Customer list inside my controller CustomersCon. <strong>$scope.Customers comes with Name &amp; Status fields. Name is the name of Customer &amp; Status is it&#8217;s state Active or Inactive</strong>. In HTML body I am showing separately Active &amp; Inactive Customers list using ng-repeat directive. To Filter both these status type (Active &amp; Inactive) separately here I used ng-show &amp; ng-hide <a href="https://jharaphula.com/restrict-option-custom-directive/" target="_blank" rel="noopener noreferrer">directives from AngularJS</a>.</p>
<p>For Active customers list here inside ng-repeat I used ng-show=&#8221;Customer.Status==&#8217;Active'&#8221;. <strong>Similarly for inactive Customers list I used ng-hide=&#8221;Customer.Status==&#8217;Active'&#8221;</strong>. Also the same Filter can be done using ng-if. ng-show, ng-hide or ng-if can be called Conditional Filters in AngularJS. All the three ng-show, ng-hide &amp; ng-if accepts boolean values as True or False. If the value is True it will execute the statement else not. To run this demo copy the below codes to a Notepad file &amp; Save it as a HTML file. Then Open the File in your Browser.</p>
<h3>ng-repeat Conditional Filter Demo App</h3>
<pre class="brush: xml; title: ; notranslate">&lt;html ng-app=&quot;CustomersMod&quot;&gt;
&lt;head&gt;
&lt;title&gt;Example of using conditional filter with ng-repeat?&lt;/title&gt;
&lt;script src=&quot;https://ajax.googleapis.com/ajax/libs/angularjs/1.0.1/angular.min.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
var CustomersMod = angular.module('CustomersMod', []);
CustomersMod.controller('CustomersCon', function ($scope) {
$scope.Customers = [
{'Name': 'Airtel', 'Status': 'Active'},
{'Name': 'Vodafone', 'Status': 'inActive'},
{'Name': 'Aircel', 'Status': 'Active'},
{'Name': 'Microsoft Corporation', 'Status': 'Active'},
{'Name': 'Covansys', 'Status': 'inActive'},
{'Name': 'Infosys', 'Status': 'Active'},
{'Name': 'Intel', 'Status': 'Active'},
{'Name': 'Capgemini', 'Status': 'inActive'},
{'Name': 'Dell', 'Status': 'Active'},
{'Name': 'Intex', 'Status': 'Active'},
{'Name': 'Samsung', 'Status': 'inActive'},
{'Name': 'Nokia', 'Status': 'inActive'},
{'Name': 'Motorola', 'Status': 'Active'}
];
});
&lt;/script&gt;
&lt;/head&gt;
&lt;body ng-controller=&quot;CustomersCon&quot;&gt;
List of Customers
&lt;hr /&gt;
&lt;b&gt;Active...&lt;/b&gt;
&lt;ul&gt;
&lt;li ng-repeat=&quot;Customer in Customers&quot; ng-show=&quot;Customer.Status=='Active'&quot;&gt;{{Customer.Name}}&lt;/li&gt;
&lt;/ul&gt;
&lt;b&gt;inActive...&lt;/b&gt;
&lt;ul&gt;
&lt;li ng-repeat=&quot;Customer in Customers&quot; ng-hide=&quot;Customer.Status=='Active'&quot;&gt;{{Customer.Name}}&lt;/li&gt;
&lt;/ul&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>
<p>The post <a href="https://jharaphula.com/ng-repeat-conditional-filter-angularjs/">Example of ng-repeat Conditional Filter to bind data in AngularJS</a> appeared first on <a href="https://jharaphula.com">OneStop Shop</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://jharaphula.com/ng-repeat-conditional-filter-angularjs/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			<media:content url="https://jharaphula.com/wp-content/uploads/2016/05/ng-repeat-in-angularjs.png" medium="image" />
	</item>
		<item>
		<title>Angularjs Routing Example using ng-view &#038; routeProvider</title>
		<link>https://jharaphula.com/angularjs-routing-example-routeprovider/</link>
					<comments>https://jharaphula.com/angularjs-routing-example-routeprovider/#respond</comments>
		
		<dc:creator><![CDATA[Biswabhusan Panda]]></dc:creator>
		<pubDate>Fri, 13 May 2016 18:58:12 +0000</pubDate>
				<category><![CDATA[AngularJS with Examples]]></category>
		<category><![CDATA[AngularJS]]></category>
		<category><![CDATA[Angularjs Routing Example]]></category>
		<category><![CDATA[routeProvider]]></category>
		<category><![CDATA[using ng-view]]></category>
		<guid isPermaLink="false">http://box.jharaphula.com/?p=761</guid>

					<description><![CDATA[<img width="300" height="179" src="https://jharaphula.com/wp-content/uploads/2016/05/routing-300x179.jpg" class="webfeedsFeaturedVisual wp-post-image" alt="Angularjs routing example using ng-view &amp; routeProvider" style="display: block; margin-bottom: 10px; clear: both; max-width: 100%;" decoding="async" loading="lazy" srcset="https://jharaphula.com/wp-content/uploads/2016/05/routing-300x179.jpg 300w, https://jharaphula.com/wp-content/uploads/2016/05/routing.jpg 750w" sizes="auto, (max-width: 300px) 100vw, 300px" /><p>AngularJS Routing is the technique using which in a web application we can render multiple pages in a Single page without refresh the page. This...</p>
<p>The post <a href="https://jharaphula.com/angularjs-routing-example-routeprovider/">Angularjs Routing Example using ng-view &#038; routeProvider</a> appeared first on <a href="https://jharaphula.com">OneStop Shop</a>.</p>
]]></description>
										<content:encoded><![CDATA[<img width="300" height="179" src="https://jharaphula.com/wp-content/uploads/2016/05/routing-300x179.jpg" class="webfeedsFeaturedVisual wp-post-image" alt="Angularjs routing example using ng-view &amp; routeProvider" style="display: block; margin-bottom: 10px; clear: both; max-width: 100%;" decoding="async" loading="lazy" srcset="https://jharaphula.com/wp-content/uploads/2016/05/routing-300x179.jpg 300w, https://jharaphula.com/wp-content/uploads/2016/05/routing.jpg 750w" sizes="auto, (max-width: 300px) 100vw, 300px" /><p>AngularJS Routing is the technique using which in a web application we can render multiple pages in a Single page without refresh the page. This technique is popular as &#8220;Single page Application&#8221; designing. To clarify your queries related to routing &#038; routeProvider here I am with AngularJS routing example. In the below app I am with 3 pages Template-A.html, Template-B.html &amp; Template-Param.html. In my Index.html I created an <a href="https://jharaphula.com/category/programming-solutions/learn-angularjs-with-examples/" target="_blank" rel="noopener noreferrer">AngularJS</a> module &#8220;routingApp&#8221;. Inside the module I am configuring the module for Angularjs routeProvider.</p>
<p>Using $routeProvider I am showing my three pages Template-A.html, Template-B.html &amp; Template-Param.html in ng-view div. $routeProvider.when is used to detect the browser url &amp; loads the respective html Template. Here in the below example I have 3 links in html body. Depending upon their href values the when statement works in routeProvider. For the first link I am sending Template-A to the browser like /Template-A. While the user click the first link inside $routeProvider function he will conditionally forcing the ng-view div to load Template-A.html. This is declared in templateUrl of $routeProvider.when. Including templateUrl here I am assigning the specific Controller for the specific template. For an example for Template-A I created Controller-A.</p>
<p><img loading="lazy" decoding="async" src="https://jharaphula.com/wp-content/uploads/2016/05/ng-routing.png" alt="ng-routing" width="751" height="230" class="alignnone size-full wp-image-3043" srcset="https://jharaphula.com/wp-content/uploads/2016/05/ng-routing.png 751w, https://jharaphula.com/wp-content/uploads/2016/05/ng-routing-300x92.png 300w" sizes="auto, (max-width: 751px) 100vw, 751px" /></p>
<p>To show you the Complete features of AngularJS Routing here I created two more pages Template-B.html &amp; Template-Param.html. Template-B is an example to show you how to pass Custom data using AngularJS Routing. In Template-Param you can found the example How to pass parameters using AngularJS Routing. First let us talk about Template-B. While use click on Template-B link including templateUrl &amp; Controller details here I added one customData attribute. Using this way you can pass custom data in your routing mechanism. To show this custom data in Template-B.html inside the Controller-B I am assigning this data to a scope variable $scope.customData. In the next phase I am just printing this $scope.customData variable to my Template-B.html.</p>
<p>In Template-C I am showing the example how to pass parameters using AngularJS Routing. During the click of &#8220;Template Param&#8221; link in body I am calling a URL &#8220;Template-Param&#8221; with an id value 237. During $routeProvider.when using /Template-Param/:id I am sending the id value to the Template-Param controller. In Controller-Param I am using $routeParams to assign the id to a scope variable using $scope.paramId = $routeParams.id;.</p>
<p>In this example you can found How to use AngularJS Routing with How to pass parameters in AngularJS Routing &amp; How to pass custom data in AngularJS Routing. To run this example in your local desk copy the below four files in their respective name. Store them in a folder &amp; open Index.html.</p>
<h3>angularjs-routing-example.htm</h3>
<pre class="brush: xml; title: ; notranslate">&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;
&lt;title&gt;Example to show how to use AngularJS Routing&lt;/title&gt;
&lt;script src=&quot;http://ajax.googleapis.com/ajax/libs/angularjs/1.0.7/angular.min.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
/* Angular module */
var routingApp = angular.module('routingApp', []);

/* Define Routing */
routingApp.config(['$routeProvider',
function($routeProvider) {
$routeProvider.
when('/Template-A', {
templateUrl: 'Template-A.htm',
controller: 'Controller-A'
}).
when('/Template-B', {
templateUrl: 'Template-B.htm',
controller: 'Controller-B',
customData: 'Template B Custom Data'
}).
when('/Template-Param/:id', {
templateUrl: 'Template-Param.htm',
controller: 'Controller-Param'
}).
otherwise({
redirectTo: '/Template-A'
});
}]);

/* Controller for Template A */
routingApp.controller('Controller-A', function($scope) {
$scope.message = 'Message from Controller A. Using Routing showing in Template A.';
});

/* Controller for Template B */
routingApp.controller('Controller-B', function($scope, $route) {
$scope.message = 'Message from Controller B. Using Routing showing in Template B.';
$scope.customData = $route.current.customData;
});

/* Controller for Template Param */
routingApp.controller('Controller-Param', function($scope, $routeParams) {
$scope.message = 'Message from Controller Param. Using Routing showing in Template Param.';
$scope.paramId = $routeParams.id;
});

&lt;/script&gt;
&lt;/head&gt;
&lt;body ng-app=&quot;routingApp&quot;&gt;
&lt;a href=&quot;#Template-A&quot;&gt;Template A&lt;/a&gt;
&lt;a href=&quot;#Template-B&quot;&gt;Template B&lt;/a&gt;
&lt;a href=&quot;#Template-Param/237&quot;&gt;Template Param&lt;/a&gt;
&lt;!--ng-view to show different Templates--&gt;
&lt;div ng-view&gt;&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>
<h3>Template-A.htm</h3>
<pre class="brush: xml; title: ; notranslate">&lt;h2&gt;Template A&lt;/h2&gt;
{{ message }}</pre>
<h3>Template-B.htm</h3>
<pre class="brush: xml; title: ; notranslate">&lt;h2&gt;Template B&lt;/h2&gt;
{{ message }}
&lt;br /&gt;
{{ customData }}</pre>
<h3>Template-Param.htm</h3>
<pre class="brush: xml; title: ; notranslate">&lt;h2&gt;Template Param&lt;/h2&gt;
{{ message }}
&lt;br /&gt;
{{ paramId }}</pre>
<p>The post <a href="https://jharaphula.com/angularjs-routing-example-routeprovider/">Angularjs Routing Example using ng-view &#038; routeProvider</a> appeared first on <a href="https://jharaphula.com">OneStop Shop</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://jharaphula.com/angularjs-routing-example-routeprovider/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			<media:content url="https://jharaphula.com/wp-content/uploads/2016/05/routing.jpg" medium="image" />
	</item>
		<item>
		<title>Example of Switch Case in AngularJS using ng-switch Directive</title>
		<link>https://jharaphula.com/example-angularjs-switch-case/</link>
					<comments>https://jharaphula.com/example-angularjs-switch-case/#respond</comments>
		
		<dc:creator><![CDATA[Biswabhusan Panda]]></dc:creator>
		<pubDate>Fri, 13 May 2016 18:53:54 +0000</pubDate>
				<category><![CDATA[AngularJS with Examples]]></category>
		<category><![CDATA[Example of Switch Case]]></category>
		<category><![CDATA[Switch Case in AngularJS]]></category>
		<category><![CDATA[Using ng-switch Directive]]></category>
		<guid isPermaLink="false">http://box.jharaphula.com/?p=757</guid>

					<description><![CDATA[<img width="300" height="191" src="https://jharaphula.com/wp-content/uploads/2016/05/Switch-Case-in-AngularJS-300x191.png" class="webfeedsFeaturedVisual wp-post-image" alt="Example of Switch Case in AngularJS using ng-switch Directive" style="display: block; margin-bottom: 10px; clear: both; max-width: 100%;" decoding="async" loading="lazy" srcset="https://jharaphula.com/wp-content/uploads/2016/05/Switch-Case-in-AngularJS-300x191.png 300w, https://jharaphula.com/wp-content/uploads/2016/05/Switch-Case-in-AngularJS.png 750w" sizes="auto, (max-width: 300px) 100vw, 300px" /><p>As a good programmer you need to know the advantages of using Switch Case in place of If and Else. Modern Programming languages compiles switch...</p>
<p>The post <a href="https://jharaphula.com/example-angularjs-switch-case/">Example of Switch Case in AngularJS using ng-switch Directive</a> appeared first on <a href="https://jharaphula.com">OneStop Shop</a>.</p>
]]></description>
										<content:encoded><![CDATA[<img width="300" height="191" src="https://jharaphula.com/wp-content/uploads/2016/05/Switch-Case-in-AngularJS-300x191.png" class="webfeedsFeaturedVisual wp-post-image" alt="Example of Switch Case in AngularJS using ng-switch Directive" style="display: block; margin-bottom: 10px; clear: both; max-width: 100%;" decoding="async" loading="lazy" srcset="https://jharaphula.com/wp-content/uploads/2016/05/Switch-Case-in-AngularJS-300x191.png 300w, https://jharaphula.com/wp-content/uploads/2016/05/Switch-Case-in-AngularJS.png 750w" sizes="auto, (max-width: 300px) 100vw, 300px" /><p>As a good programmer you need to know the advantages of using Switch Case in place of If and Else. <strong>Modern Programming languages compiles switch case more faster than if &amp; else</strong>. During application development using switch case we can achieve better performance for Conditional statements. It&#8217;s no matter if you are using if &amp; else for 4 to 5 conditional statements. But in-case you are handling more then 4 to 5 Conditional statements to Compare values in such case prefer to use Switch Case in AngularJS in place of if and else.</p>
<p>In the below example I am showing <a href="https://jharaphula.com/category/programming-solutions/learn-angularjs-with-examples/" target="_blank" rel="noopener noreferrer">how to use AngularJS</a> Switch Case. Look at the Codes below. Here inside the Controller I declared an options object to the $Scope. Options array contains six items. In html body I have a dropdownlist which shows me the list of values from this options array. Depending upon the selected value from dropdownlist I am showing a div with appropriate message. In the primary div of switch cases messages I am <strong>using ng-switch on=&#8221;selection&#8221; to instruct on which values</strong> switch case will occur. Here &#8220;selection&#8221; is my ng-model. Which is declared in my select control. To check each case from options array I am using ng-switch-when &amp; for default value like &#8216;Others&#8217; from options array I am <strong>using ng-switch-default to show the default massage</strong>.</p>
<p>To run the below example copy the codes to a Notepad file. Save it as a html File. Then open the HTML file with internet Connectivity. This demo app contains CDN links. Without Internet this will not work.</p>
<h3>Switch Case in AngularJS Example</h3>
<pre class="brush: xml; title: ; notranslate">&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;
&lt;title&gt;How to use Switch Case in AngularJS?&lt;/title&gt;
&lt;!--AngularJS CDN Link--&gt;
&lt;script src=&quot;https://ajax.googleapis.com/ajax/libs/angularjs/1.3.8/angular.min.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
(function(angular) {
angular.module('modSwitch', [])
.controller('ControllerSwitch', ['$scope', function($scope) {
$scope.options = ['Blog', 'Business', 'Fashion', 'Career', 'Education', 'Others'];
$scope.selection = $scope.options[0];
}]);
})(window.angular);
&lt;/script&gt;
&lt;/head&gt;
&lt;body ng-app=&quot;modSwitch&quot;&gt;
&lt;div ng-controller=&quot;ControllerSwitch&quot;&gt;
&lt;select ng-model=&quot;selection&quot; ng-options=&quot;item for item in options&quot;&gt;
&lt;/select&gt;
&lt;hr/&gt;
&lt;div ng-switch on=&quot;selection&quot;&gt;
&lt;div ng-switch-when=&quot;Blog&quot;&gt;Blog is a Business.&lt;/div&gt;
&lt;div ng-switch-when=&quot;Business&quot;&gt;Business is a Busy Game.&lt;/div&gt;
&lt;div ng-switch-when=&quot;Fashion&quot;&gt;Fashion updates Everyday.&lt;/div&gt;
&lt;div ng-switch-when=&quot;Career&quot;&gt;Career is Like a Ladder.&lt;/div&gt;
&lt;div ng-switch-when=&quot;Education&quot;&gt;Education Never Ends.&lt;/div&gt;
&lt;div ng-switch-default&gt;This is the Default value for Switch Case.&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>
<h3>Alternatives to *ngSwitch</h3>
<p>While `*ngSwitch` is useful, there are alternative approaches:</p>
<p><strong>`ngIf` with Else</strong> – For simple binary conditions, `ngIf` may be more straightforward.<br />
<strong>Custom Directive</strong> – For complex scenarios, a custom structural directive can provide more flexibility.<br />
<strong>Component Binding</strong> – Sometimes, passing inputs to a single component is cleaner than switching between multiple templates.</p>
<h3>Conclusion</h3>
<p>The `ngSwitch` directive in Angular provides a clean and efficient way to handle conditional rendering based on different values. By understanding its syntax, use cases, and best practices, developers can create more dynamic and maintainable applications. Whether displaying role-based content, switching between views, or handling enums, `ngSwitch` is a powerful tool in the Angular developer’s toolkit. Always ensure proper case handling and consider alternatives when dealing with highly complex scenarios.</p>
<p>The post <a href="https://jharaphula.com/example-angularjs-switch-case/">Example of Switch Case in AngularJS using ng-switch Directive</a> appeared first on <a href="https://jharaphula.com">OneStop Shop</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://jharaphula.com/example-angularjs-switch-case/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			<media:content url="https://jharaphula.com/wp-content/uploads/2016/05/Switch-Case-in-AngularJS.png" medium="image" />
	</item>
		<item>
		<title>Example of responsive AngularJS Dynamic Tabs using BootStrap 5</title>
		<link>https://jharaphula.com/example-angularjs-dynamic-tabs-bootstrap/</link>
					<comments>https://jharaphula.com/example-angularjs-dynamic-tabs-bootstrap/#respond</comments>
		
		<dc:creator><![CDATA[Biswabhusan Panda]]></dc:creator>
		<pubDate>Fri, 13 May 2016 18:48:08 +0000</pubDate>
				<category><![CDATA[AngularJS with Examples]]></category>
		<category><![CDATA[AngularJS Dynamic Tabs]]></category>
		<category><![CDATA[BootStrap]]></category>
		<category><![CDATA[Dynamic Tabs using BootStrap]]></category>
		<guid isPermaLink="false">http://box.jharaphula.com/?p=754</guid>

					<description><![CDATA[<img width="300" height="195" src="https://jharaphula.com/wp-content/uploads/2016/05/tab-view-300x195.png" class="webfeedsFeaturedVisual wp-post-image" alt="Example to Create responsive AngularJS Dynamic Tabs using BootStrap" style="display: block; margin-bottom: 10px; clear: both; max-width: 100%;" decoding="async" loading="lazy" srcset="https://jharaphula.com/wp-content/uploads/2016/05/tab-view-300x195.png 300w, https://jharaphula.com/wp-content/uploads/2016/05/tab-view-294x190.png 294w, https://jharaphula.com/wp-content/uploads/2016/05/tab-view-106x70.png 106w, https://jharaphula.com/wp-content/uploads/2016/05/tab-view.png 750w" sizes="auto, (max-width: 300px) 100vw, 300px" /><p>During web application development many times we required to implement dynamic tab for better user experience. In this example I am sharing the codes to...</p>
<p>The post <a href="https://jharaphula.com/example-angularjs-dynamic-tabs-bootstrap/">Example of responsive AngularJS Dynamic Tabs using BootStrap 5</a> appeared first on <a href="https://jharaphula.com">OneStop Shop</a>.</p>
]]></description>
										<content:encoded><![CDATA[<img width="300" height="195" src="https://jharaphula.com/wp-content/uploads/2016/05/tab-view-300x195.png" class="webfeedsFeaturedVisual wp-post-image" alt="Example to Create responsive AngularJS Dynamic Tabs using BootStrap" style="display: block; margin-bottom: 10px; clear: both; max-width: 100%;" decoding="async" loading="lazy" srcset="https://jharaphula.com/wp-content/uploads/2016/05/tab-view-300x195.png 300w, https://jharaphula.com/wp-content/uploads/2016/05/tab-view-294x190.png 294w, https://jharaphula.com/wp-content/uploads/2016/05/tab-view-106x70.png 106w, https://jharaphula.com/wp-content/uploads/2016/05/tab-view.png 750w" sizes="auto, (max-width: 300px) 100vw, 300px" /><p>During web application development many times we required to implement dynamic tab for better user experience. In this example I am sharing the codes to create AngularJS Dynamic Tabs using <a href="https://jharaphula.com/learn-bootstrap-tutorial-beginners/" target="_blank" rel="noopener noreferrer">BootStrap</a>. Here to show you a demo I created 4 states of India as the tabs. Under each tab I am showing the cities for that for that particular state dynamically.</p>
<h2>AngularJS directive</h2>
<p>The <a href="https://jharaphula.com/restrict-option-custom-directive/" target="_blank" rel="noopener noreferrer">AngularJS directive</a> here I create for my tab control is ngTab. Which <strong>accepts two parameters length &amp; data</strong>. Length is the number of tabs we required. When data is the states &amp; it&#8217;s cities. Data is in JSON format. You can replace this data as per your requirements. <strong>To get these parameters values in AngularJS ngTab directive I am using scope: { &#8220;length&#8221;: &#8216;=&#8217;, &#8220;data&#8221;: &#8216;@&#8217; }</strong>. You can watch this in the below app.js file. To create responsive Tabs I used BootStrap here. my-tab.html is my template for ngTab. In template file I am binding the state &amp; cities values (In form of array) from the scope object of TabModule.</p>
<p>To run this demo application you need to create 3 files as index.html, app.js &amp; my-tab.html. Copy the below codes to the respective files. With internet connection run the index.html. It will show you the result like the below screen.</p>
<p><img loading="lazy" decoding="async" class="alignnone size-full wp-image-3080" src="https://jharaphula.com/wp-content/uploads/2016/05/tab.png" alt="tab" width="943" height="278" srcset="https://jharaphula.com/wp-content/uploads/2016/05/tab.png 943w, https://jharaphula.com/wp-content/uploads/2016/05/tab-300x88.png 300w" sizes="auto, (max-width: 943px) 100vw, 943px" /></p>
<h3>AngularJS Dynamic Tabs using BootStrap</h3>
<pre class="brush: xml; title: ; notranslate">&lt;!DOCTYPE html&gt;
&lt;html ng-app=&quot;tabModule&quot;&gt;
&lt;head&gt;
&lt;meta charset=&quot;utf-8&quot;&gt;
&lt;title&gt;Example to Create responsive AngularJS Dynamic Tabs&lt;/title&gt;
&lt;!--AngularJS library CDN link--&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;https://ajax.googleapis.com/ajax/libs/angularjs/1.3.0-rc.0/angular.min.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;app.js&quot;&gt;&lt;/script&gt;
&lt;!--Jquery library CDN link--&gt;
&lt;script src=&quot;http://code.jquery.com/jquery-1.11.0.min.js&quot;&gt;&lt;/script&gt;
&lt;!--Jquery UI CDN link--&gt;
&lt;script src=&quot;http://code.jquery.com/ui/1.11.1/jquery-ui.js&quot;&gt;&lt;/script&gt;
&lt;!--BootStrap CDN links--&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;http://netdna.bootstrapcdn.com/twitter-bootstrap/2.1.1/js/bootstrap.js&quot;&gt;&lt;/script&gt;
&lt;link href=&quot;http://netdna.bootstrapcdn.com/twitter-bootstrap/2.1.1/css/bootstrap.no-icons.min.css&quot; rel=&quot;stylesheet&quot;&gt;
&lt;link href=&quot;http://netdna.bootstrapcdn.com/font-awesome/2.0/css/font-awesome.css&quot; rel=&quot;stylesheet&quot;&gt;
&lt;link rel=&quot;stylesheet&quot; href=&quot;http://netdna.bootstrapcdn.com/twitter-bootstrap/2.1.1/css/bootstrap.min.css&quot; type=&quot;text/css&quot;&gt;
&lt;link rel=&quot;stylesheet&quot; href=&quot;http://netdna.bootstrapcdn.com/twitter-bootstrap/2.1.1/css/bootstrap-theme.min.css&quot; type=&quot;text/css&quot;&gt;
&lt;link rel=&quot;stylesheet&quot; href=&quot;http://code.jquery.com/ui/1.11.1/themes/smoothness/jquery-ui.css&quot;&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;ng-tab length=&quot;4&quot; data='{&quot;Country&quot;:[{&quot;state&quot;:&quot;Maharashtra&quot;, &quot;cities&quot;:&quot;Mumbai, Pune, Nagpur, Thane, Nashik&quot;},{&quot;state&quot;:&quot;Odisha&quot;, &quot;cities&quot;:&quot;Bhubaneswar, Cuttack, Rourkela, Brahmapur, Sambalpur&quot;},{&quot;state&quot;:&quot;Karnataka&quot;, &quot;cities&quot;:&quot;Bellary, Bidar, Gulbarga, Koppal, Raichur&quot;},{&quot;state&quot;:&quot;Chandigarh&quot;, &quot;cities&quot;:&quot;Ludhiana, Amritsar, Jalandhar, Patiala, Bathinda&quot;}]}'&gt;&lt;/ng-tab&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>
<h3>my-tab.htm</h3>
<pre class="brush: xml; title: ; notranslate">&lt;!--ngTab Template--&gt;
&lt;h3&gt;&lt;center&gt;{{ appDetails }}&lt;/center&gt;&lt;/h3&gt;
&lt;div class=&quot;container&quot;&gt;
&lt;div id=&quot;content&quot;&gt;
&lt;ul id=&quot;tabs&quot; class=&quot;nav nav-tabs&quot; data-tabs=&quot;tabs&quot;&gt;
&lt;li ng-class=&quot;{active: $first}&quot; ng-repeat=&quot;item in tempArrTab&quot;&gt;
&lt;a href=&quot;#{{ item }}&quot; data-toggle=&quot;tab&quot;&gt;{{ item }}&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;div id=&quot;my-tab-content&quot; class=&quot;tab-content&quot;&gt;
&lt;div ng-repeat=&quot;item in tempArrTab&quot; class=&quot;tab-pane&quot; ng-class=&quot;{active: $first}&quot; id=&quot;{{ item }}&quot;&gt;
&lt;h2&gt;{{ item }}&lt;/h2&gt;
&lt;p&gt;Welcome to {{ item }}. Visit Us.&lt;/p&gt;
Cities : &lt;input list=&quot;tags-{{ $index }}&quot;&gt;
&lt;/div&gt;

&lt;div ng-repeat=&quot;compitem in tempCompArr&quot;&gt;
&lt;datalist id=&quot;tags-{{ $index }}&quot;&gt;
&lt;option ng-repeat=&quot;items in compitem.split(',')&quot; value=&quot;{{ items }}&quot;&gt;
&lt;/datalist&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;</pre>
<h3>app.js</h3>
<pre class="brush: jscript; title: ; notranslate">/* ng-tab Module */
angular.module('tabModule', []).directive('ngTab', function() {
return {
restrict: 'E',
transclude: true,

scope: {
/* Accepting the number of Tab you want in your app */
&quot;length&quot;: '=',
/* Accepting the data in JSON for Tab */
&quot;data&quot;: '@'
},

link: function (scope, element) {
scope.$watch(&quot;length&quot;, function (arrlen) {
scope.$watch(&quot;data&quot;, function (value) {

var obj = JSON.parse(value);

var lenjson = obj.Country.length;

var arrTab = [];
var autoCompArray = [];

/* Assigning input JSON data to Array */
if (arrlen == lenjson) {
for(i=0; i&lt;lenjson; i++) {
arrTab.push(obj.Country[i].state);
autoCompArray.push(obj.Country[i].cities)
}
} else {
alert('Please provide accurate data length.');
}

scope.tempArrTab = arrTab;
scope.tempCompArr = autoCompArray;
scope.appDetails = 'Create your own ng-tab using AngularJS';

}, false);

}, false);
},

controller: function($scope, $filter) {

$(function() {
$(&quot;#tabs&quot;).tabs();
});
},
templateUrl: 'my-tab.htm'
};
});</pre>
<p>The post <a href="https://jharaphula.com/example-angularjs-dynamic-tabs-bootstrap/">Example of responsive AngularJS Dynamic Tabs using BootStrap 5</a> appeared first on <a href="https://jharaphula.com">OneStop Shop</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://jharaphula.com/example-angularjs-dynamic-tabs-bootstrap/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			<media:content url="https://jharaphula.com/wp-content/uploads/2016/05/tab-view.png" medium="image" />
	</item>
		<item>
		<title>AngularJS Treeview Example using Data from Controller</title>
		<link>https://jharaphula.com/angularjs-treeview-example-controller/</link>
					<comments>https://jharaphula.com/angularjs-treeview-example-controller/#respond</comments>
		
		<dc:creator><![CDATA[Biswabhusan Panda]]></dc:creator>
		<pubDate>Fri, 13 May 2016 18:25:46 +0000</pubDate>
				<category><![CDATA[AngularJS with Examples]]></category>
		<category><![CDATA[AngularJS Treeview Example]]></category>
		<category><![CDATA[Data from Controller]]></category>
		<category><![CDATA[Treeview Example]]></category>
		<guid isPermaLink="false">http://box.jharaphula.com/?p=738</guid>

					<description><![CDATA[<img width="300" height="194" src="https://jharaphula.com/wp-content/uploads/2016/05/angularjs-treeview-example-300x194.jpg" class="webfeedsFeaturedVisual wp-post-image" alt="AngularJS Treeview Example using Data from Controller" style="display: block; margin-bottom: 10px; clear: both; max-width: 100%;" decoding="async" loading="lazy" srcset="https://jharaphula.com/wp-content/uploads/2016/05/angularjs-treeview-example-300x194.jpg 300w, https://jharaphula.com/wp-content/uploads/2016/05/angularjs-treeview-example-294x190.jpg 294w, https://jharaphula.com/wp-content/uploads/2016/05/angularjs-treeview-example-106x70.jpg 106w, https://jharaphula.com/wp-content/uploads/2016/05/angularjs-treeview-example.jpg 610w" sizes="auto, (max-width: 300px) 100vw, 300px" /><p>Treeview is a Classical fashion to display hierarchy of data. In less area using Treeview we can show large amount of data. Treeview works under...</p>
<p>The post <a href="https://jharaphula.com/angularjs-treeview-example-controller/">AngularJS Treeview Example using Data from Controller</a> appeared first on <a href="https://jharaphula.com">OneStop Shop</a>.</p>
]]></description>
										<content:encoded><![CDATA[<img width="300" height="194" src="https://jharaphula.com/wp-content/uploads/2016/05/angularjs-treeview-example-300x194.jpg" class="webfeedsFeaturedVisual wp-post-image" alt="AngularJS Treeview Example using Data from Controller" style="display: block; margin-bottom: 10px; clear: both; max-width: 100%;" decoding="async" loading="lazy" srcset="https://jharaphula.com/wp-content/uploads/2016/05/angularjs-treeview-example-300x194.jpg 300w, https://jharaphula.com/wp-content/uploads/2016/05/angularjs-treeview-example-294x190.jpg 294w, https://jharaphula.com/wp-content/uploads/2016/05/angularjs-treeview-example-106x70.jpg 106w, https://jharaphula.com/wp-content/uploads/2016/05/angularjs-treeview-example.jpg 610w" sizes="auto, (max-width: 300px) 100vw, 300px" /><p>Treeview is a Classical fashion to display hierarchy of data. In less area <strong>using Treeview we can show large amount of data</strong>. Treeview works under parent child relationship. Parent is called node &amp; the sub-items are called Child&#8217;s. Whether you do maintain a JSON file or Database AngularJS Treeview required relationship in Data.</p>
<p>In the below example I created an <a href="https://jharaphula.com/category/programming-solutions/learn-angularjs-with-examples/" target="_blank" rel="noopener noreferrer">AngularJS</a> Treeview using data from items object under $scope. Here Countries are the nodes &amp; States are the Child&#8217;s. To design this demo here <strong>I have 3 files index.html, treeview.html &amp; app.js</strong>. Index.html is the primary file where I refereed CDN link of AngularJS library. Treeview.html is the file where I am creating the template for treeview. App.js is the file where i implemented my logic&#8217;s to create a treeview using AngularJS. The module I create in app.js is treeview. <strong>Inside the module I have a directive called ngTree</strong>. In $scope I am assigning country &amp; states as items. In items array country is the parent node when states are the child&#8217;s. In treeview.html using ng-click I am calling the function showStates(), which is in the $scope of app.js. This function helps to expand &amp; collapse the nodes.</p>
<h3>Angularjs Treeview Example</h3>
<p><img loading="lazy" decoding="async" src="https://jharaphula.com/wp-content/uploads/2016/05/angularjs-tree.png" title="Angularjs Treeview Example" alt="Angularjs Treeview Example" width="720" height="285" class="alignnone size-full wp-image-3084" srcset="https://jharaphula.com/wp-content/uploads/2016/05/angularjs-tree.png 720w, https://jharaphula.com/wp-content/uploads/2016/05/angularjs-tree-300x119.png 300w" sizes="auto, (max-width: 720px) 100vw, 720px" /></p>
<p>To run the below example Copy these code to notepad. Save it as index.html, treeview.html &amp; app.js in a same folder. Before run the index.html make sure you are with Internet Connectivity.</p>
<h3>index.htm</h3>
<pre class="brush: xml; title: ; notranslate">&lt;!DOCTYPE html&gt;
&lt;html ng-app=&quot;treeview&quot;&gt;
&lt;head&gt;
&lt;meta charset=&quot;utf-8&quot;&gt;
&lt;title&gt;Example to Create Treeview using AngularJS&lt;/title&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;https://ajax.googleapis.com/ajax/libs/angularjs/1.3.0-rc.0/angular.min.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;app.js&quot;&gt;&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;ng-tree&gt;&lt;/ng-tree&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>
<h3>treeview.htm</h3>
<pre class="brush: xml; title: ; notranslate">&lt;ul&gt;
&lt;li ng-repeat=&quot;item in items&quot; ng-click=&quot;showStates(item)&quot;&gt;
&lt;span&gt;{{item.country}}&lt;/span&gt;
&lt;ul&gt;
&lt;li ng-repeat=&quot;subItem in item.states&quot; ng-show=&quot;item.active&quot;&gt;
&lt;span&gt;{{subItem.state}}&lt;/span&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;</pre>
<h3>app.js</h3>
<pre class="brush: jscript; title: ; notranslate">angular.module('treeview', [])
.directive('ngTree', function() {
return {
restrict: 'E',
transclude: true,

controller: function($scope) {

$scope.showStates = function(item){
item.active = !item.active;
};

$scope.items = [
{
country: &quot;INDIA&quot;,
states: [
{state: &quot;Assam&quot;},
{state: &quot;Chhattisgarh&quot;},
{state: &quot;Sikkim&quot;},
{state: &quot;Maharashtra&quot;},
{state: &quot;Madhya Pradesh&quot;}
]
},
{
country: &quot;UNITED STATES&quot;,
states: [
{state: &quot;Alabama&quot;},
{state: &quot;California&quot;},
{state: &quot;Hawaii&quot;},
{state: &quot;Michigan&quot;},
{state: &quot;New York&quot;},
{state: &quot;Washington&quot;}
]
},
{
country: &quot;PAKISTAN&quot;,
states: [
{state: &quot;Peshawar&quot;},
{state: &quot;Lahore&quot;},
{state: &quot;Karachi&quot;},
{state: &quot;Islamabad&quot;}
]
}
];
},
templateUrl: 'treeview.htm'
};
});</pre>
<p>The post <a href="https://jharaphula.com/angularjs-treeview-example-controller/">AngularJS Treeview Example using Data from Controller</a> appeared first on <a href="https://jharaphula.com">OneStop Shop</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://jharaphula.com/angularjs-treeview-example-controller/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			<media:content url="https://jharaphula.com/wp-content/uploads/2016/05/angularjs-treeview-example.jpg" medium="image" />
	</item>
		<item>
		<title>Example of using AngularJS Filter &#038; built-in Filters</title>
		<link>https://jharaphula.com/example-of-angularjs-filter/</link>
					<comments>https://jharaphula.com/example-of-angularjs-filter/#respond</comments>
		
		<dc:creator><![CDATA[Biswabhusan Panda]]></dc:creator>
		<pubDate>Fri, 13 May 2016 18:02:51 +0000</pubDate>
				<category><![CDATA[AngularJS with Examples]]></category>
		<category><![CDATA[AngularJS Filter]]></category>
		<category><![CDATA[built-in Filters]]></category>
		<category><![CDATA[Filters in Controllers]]></category>
		<guid isPermaLink="false">http://box.jharaphula.com/?p=720</guid>

					<description><![CDATA[<img width="300" height="190" src="https://jharaphula.com/wp-content/uploads/2016/05/AngularJS-Search-300x190.jpg" class="webfeedsFeaturedVisual wp-post-image" alt="Example of using AngularJS Filter &amp; built-in Filters" style="display: block; margin-bottom: 10px; clear: both; max-width: 100%;" decoding="async" loading="lazy" srcset="https://jharaphula.com/wp-content/uploads/2016/05/AngularJS-Search-300x190.jpg 300w, https://jharaphula.com/wp-content/uploads/2016/05/AngularJS-Search.jpg 750w" sizes="auto, (max-width: 300px) 100vw, 300px" /><p>AngularJS is a High Level Programming language. To search data from a list of records AngularJS provides filter keyword. AngularJS Filter is a way that...</p>
<p>The post <a href="https://jharaphula.com/example-of-angularjs-filter/">Example of using AngularJS Filter &#038; built-in Filters</a> appeared first on <a href="https://jharaphula.com">OneStop Shop</a>.</p>
]]></description>
										<content:encoded><![CDATA[<img width="300" height="190" src="https://jharaphula.com/wp-content/uploads/2016/05/AngularJS-Search-300x190.jpg" class="webfeedsFeaturedVisual wp-post-image" alt="Example of using AngularJS Filter &amp; built-in Filters" style="display: block; margin-bottom: 10px; clear: both; max-width: 100%;" decoding="async" loading="lazy" srcset="https://jharaphula.com/wp-content/uploads/2016/05/AngularJS-Search-300x190.jpg 300w, https://jharaphula.com/wp-content/uploads/2016/05/AngularJS-Search.jpg 750w" sizes="auto, (max-width: 300px) 100vw, 300px" /><p>AngularJS is a High Level Programming language. To search data from a list of records AngularJS provides filter keyword. AngularJS Filter is a way that will help you to transform your data to an appropriate representation in the View in a certain format. There are many inbuilt filters provided by AngularJS that give us the way to format our data in View. With these built-in filters, we can format &amp; show our data in various ways. Text can be shown in uppercase, lowercase. Date can be also represented in various formats. All we need to do is add a &#8220;|&#8221; (pipe) after the data.</p>
<p>In the following example I listed out many countries in Controller with a scope variable Countries. Using an input control I am passing my search queries. <a href="https://jharaphula.com/beginners-learn-angularjs-with-examples/" target="_blank" rel="noopener noreferrer">AngularJS</a> ng-model works here to make the input control as a query passing control. While binding data using ng-repeat to a ul element I used filter keyword to filter my query.</p>
<p>To run this example you can copy this code to a notepad file &amp; save it as html. I am using CDN link to refer AngularJS library. To successfully run the example below be sure you are with Internet Connectivity.</p>
<h3>Example of AngularJS Filter</h3>
<pre class="brush: xml; title: ; notranslate">&lt;html ng-app=&quot;CountriesMod&quot;&gt;
&lt;head&gt;
&lt;title&gt;Example to use filter in AngularJS?&lt;/title&gt;
&lt;script src=&quot;https://ajax.googleapis.com/ajax/libs/angularjs/1.0.1/angular.min.js&quot;&gt;&lt;/script&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
var CountriesMod = angular.module('CountriesMod', []);
CountriesMod.controller('CountriesCon', function ($scope) {
$scope.Countries = [ {'CountryName': 'Afghanistan'}, {'CountryName': 'Algeria'}, {'CountryName': 'Bahamas'}, {'CountryName': 'Bangladesh'}, {'CountryName': 'Belgium'}, {'CountryName': 'Cambodia'}, {'CountryName': 'Canada'}, {'CountryName': 'Central African'}, {'CountryName': 'Denmark'}, {'CountryName': 'Indonesia'}, {'CountryName': 'India'}, {'CountryName': 'Pakistan'}, {'CountryName': 'Malaysia'}, {'CountryName': 'Romania'}, {'CountryName': 'Taiwan'} ];
});
&lt;/script&gt;
&lt;/head&gt;
&lt;body ng-controller=&quot;CountriesCon&quot;&gt;
Filter for Countries: &lt;input ng-model=&quot;query&quot;&gt;
&lt;ul&gt;
&lt;li ng-repeat=&quot;Country in Countries | filter:query&quot;&gt;{{Country.CountryName}}&lt;/li&gt;
&lt;/ul&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>
<h3>AngularJS Built-in Filters</h3>
<p><em>Filter</em> &#8211; Filter the array to a subset of it based on provided criteria.<br />
<em>Uppercase</em> &#8211; Convert the text to upper case text.<br />
<em>Lowercase</em> &#8211; Convert the text to lower case text.<br />
<em>Currency</em> &#8211; Formats the text in a currency format.<br />
<em>Order By</em> &#8211; Order the array based on provided criteria.<br />
<em>Date</em> &#8211; Format the date to a specific format.<br />
<em>Number</em> &#8211; Format the number to a string format.</p>
<p><strong>Filters to an expression</strong></p>
<p>Example to add Filter in AngularJS expression.</p>
<pre class="brush: xml; title: ; notranslate">&lt;div ng-app=&quot;myApp&quot; ng-controller=&quot;nameCtrl&quot;&gt;
&lt;p&gt;Last name is {{ lastName | lowercase }}&lt;/p&gt;
&lt;/div&gt;</pre>
<p><strong>Filters to Directives</strong></p>
<p>Example to add Filter in AngularJS Custom Directives.</p>
<pre class="brush: xml; title: ; notranslate">&lt;div ng-app=&quot;myApp&quot; ng-controller=&quot;namesCtrl&quot;&gt;
&lt;ul&gt;
&lt;li ng-repeat=” x in names | orderBy: ‘country’ “&gt;
{{ x.name + ‘, ’ + x.country}}&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;</pre>
<p><strong>Filters in controllers</strong></p>
<p>Example to injecting Filter to AngularJS Controller.</p>
<pre class="brush: jscript; title: ; notranslate">myApp.controller(&quot;myController&quot;,function($scope,$filter){
$scope.filterPhone = $filter('convertToPhone')('1234567890');
});</pre>
<p><strong>Filters in Factory</strong></p>
<p>Example of injecting Filter to Factory.</p>
<pre class="brush: jscript; title: ; notranslate">myApp.factory(&quot;myCustomService&quot;,function($filter){
return{
filteredData: $filter('uppercase')('mishra'),
};
});</pre>
<p><strong>Filters in Services</strong></p>
<p>Example to injecting Filter to Service.</p>
<pre class="brush: jscript; title: ; notranslate">myApp.service('myCustomeService',function($filter){
this.filterData = $filter('uppercase')('john');
});</pre>
<p><strong>Example of built-in Filters</strong></p>
<p>We can also create custom filter to display our data in a particular way that we want. Using .filter method we can create custom filters in Angular JS. Look at the example below.</p>
<pre class="brush: xml; title: ; notranslate">&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;
&lt;title&gt;Using AngularJS Filters&lt;/title&gt;
&lt;script src = &quot;http://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js&quot;&gt;
&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;h2&gt;AngularJS demo Application&lt;/h2&gt;
&lt;div ng-app = &quot;mainApp&quot; ng-controller = &quot;studentController&quot;&gt;
&lt;table border = &quot;0&quot;&gt;
&lt;tr&gt;
&lt;td&gt;First Name:&lt;/td&gt;
&lt;td&gt;&lt;input type = &quot;text&quot; ng-model = &quot;student.firstName&quot;&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Last Name: &lt;/td&gt;
&lt;td&gt;&lt;input type = &quot;text&quot; ng-model = &quot;student.lastName&quot;&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Fees: &lt;/td&gt;
&lt;td&gt;&lt;input type = &quot;text&quot; ng-model = &quot;student.fees&quot;&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Subject: &lt;/td&gt;
&lt;td&gt;&lt;input type = &quot;text&quot; ng-model = &quot;subjectName&quot;&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;br/&gt;
&lt;table border = &quot;0&quot;&gt;
&lt;tr&gt;
&lt;td&gt;Name in Upper Case: &lt;/td&gt;
&lt;td&gt;{{student.fullName() | uppercase}}&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Name in Lower Case: &lt;/td&gt;
&lt;td&gt;
{{student.fullName() | lowercase}}
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;fees: &lt;/td&gt;
&lt;td&gt;
{{student.fees | currency}}
&lt;/td&gt;
&lt;/tr&gt;	
&lt;tr&gt;
&lt;td&gt;Subject:&lt;/td&gt;
&lt;td&gt;
&lt;ul&gt;
&lt;li ng-repeat = &quot;subject in student.subjects | filter: subjectName |orderBy:'marks'&quot;&gt;
{{ subject.name + ', marks:' + subject.marks }}
&lt;/li&gt;
&lt;/ul&gt;
&lt;/td&gt;	
&lt;/tr&gt;	
&lt;/table&gt;
&lt;/div&gt;
&lt;script&gt;
var mainApp = angular.module(&quot;mainApp&quot;, []);
mainApp.controller('studentController', function($scope) {	
$scope.student = {
firstName: &quot;David&quot;,
lastName: &quot;Beckham&quot;,
fees: 1000,
subjects: [
{name:'Physics',marks:70},
{name:'Chemistry',marks:80},
{name:'Maths',marks:65}
],
fullName: function() {
var studentObject;
studentObject = $scope.student;
return studentObject.firstName + &quot; &quot; + studentObject.lastName;
}
};
});
&lt;/script&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>
<p>The post <a href="https://jharaphula.com/example-of-angularjs-filter/">Example of using AngularJS Filter &#038; built-in Filters</a> appeared first on <a href="https://jharaphula.com">OneStop Shop</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://jharaphula.com/example-of-angularjs-filter/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			<media:content url="https://jharaphula.com/wp-content/uploads/2016/05/AngularJS-Search.jpg" medium="image" />
	</item>
		<item>
		<title>Angular Custom Directive Tutorial with Example for Beginners</title>
		<link>https://jharaphula.com/angular-custom-directive-tutorial-example/</link>
					<comments>https://jharaphula.com/angular-custom-directive-tutorial-example/#respond</comments>
		
		<dc:creator><![CDATA[Nibedita Panda]]></dc:creator>
		<pubDate>Fri, 13 May 2016 12:26:32 +0000</pubDate>
				<category><![CDATA[AngularJS with Examples]]></category>
		<category><![CDATA[Angular Custom Directive]]></category>
		<category><![CDATA[Attribute directives]]></category>
		<category><![CDATA[TemplateURL]]></category>
		<category><![CDATA[Tutorial with Example]]></category>
		<guid isPermaLink="false">http://box.jharaphula.com/?p=521</guid>

					<description><![CDATA[<img width="300" height="203" src="https://jharaphula.com/wp-content/uploads/2016/05/Directives-in-AngularJS-300x203.jpg" class="webfeedsFeaturedVisual wp-post-image" alt="Angular Custom Directive Tutorial with Example for Beginners" style="display: block; margin-bottom: 10px; clear: both; max-width: 100%;" decoding="async" loading="lazy" srcset="https://jharaphula.com/wp-content/uploads/2016/05/Directives-in-AngularJS-300x203.jpg 300w, https://jharaphula.com/wp-content/uploads/2016/05/Directives-in-AngularJS.jpg 750w" sizes="auto, (max-width: 300px) 100vw, 300px" /><p>I can say directives are like a plugin to DOM elements which identified by AngularJS HTML compiler to render. AngularJS comes with many in-built directives...</p>
<p>The post <a href="https://jharaphula.com/angular-custom-directive-tutorial-example/">Angular Custom Directive Tutorial with Example for Beginners</a> appeared first on <a href="https://jharaphula.com">OneStop Shop</a>.</p>
]]></description>
										<content:encoded><![CDATA[<img width="300" height="203" src="https://jharaphula.com/wp-content/uploads/2016/05/Directives-in-AngularJS-300x203.jpg" class="webfeedsFeaturedVisual wp-post-image" alt="Angular Custom Directive Tutorial with Example for Beginners" style="display: block; margin-bottom: 10px; clear: both; max-width: 100%;" decoding="async" loading="lazy" srcset="https://jharaphula.com/wp-content/uploads/2016/05/Directives-in-AngularJS-300x203.jpg 300w, https://jharaphula.com/wp-content/uploads/2016/05/Directives-in-AngularJS.jpg 750w" sizes="auto, (max-width: 300px) 100vw, 300px" /><p>I can say directives are like a plugin to DOM elements which identified by AngularJS HTML compiler to render. AngularJS comes with many in-built directives to enrich our HTML. For better programmer friendly environment AngularJS provides the facility to write your own Angular Custom Directive. Directive gives freedom to write more structural UI controls. It’s easy to use &amp; effective to maintain. There are <strong>4 types of directive</strong> introduced by AngularJS.</p>
<ul>
<li>Element directives (E)</li>
<li>Attribute directives (A)</li>
<li>CSS class directives (C)</li>
<li>Comment directives (M)</li>
</ul>
<p>Using restrict option in a directive we can prevent it to any type. Name of a directive is case sensitive. Generally we <strong>use camel Case to present a directive name</strong>. Let’s take an example of ngTable. While embedding a directive in HTML typically we do lower case dash-delimited attribute on DOM elements. In case of <strong>ngTable directive while we will use this with HTML we can go for ng-table</strong>.</p>
<p>To make you clear about the full features of a directive let us discuss the available options. To create a directive we need to create a module first. Inside that module using directive keyword we can create our own custom directive. <strong>Directive is nothing but a function with return value</strong>.</p>
<h3>Angular Custom Directive Example</h3>
<pre class="brush: jscript; title: ; notranslate">var myApp = angular.module('myApp',[]);
myApp.directive('myDir', function() {
return {
template: 'Name: Biswabhusan Address: Nandanvan Colony, Wakad.'
};
});</pre>
<h3>Template &amp; TemplateURL</h3>
<p>Template &amp; TemplateURL both are responsible to present HTML in a directive. <strong>Using Template option we can pass pure HTML to a directive when TemplateURL accepts only the physical path of the HTML page</strong>. While designing a large template <strong>TemplateURL helps to divide HTMLs into segments</strong>. This approach to advanced UI designing helpful to maintain &amp; debug templates easily.</p>
<h3>Restrict option</h3>
<p>Using restrict option in a directive we can prevent the way to embed that directive in HTML. If we want to restrict a directive to attributes we have to use restrict: A. Like the same for Elements &amp; CSS Classes we can use E &amp; C. <strong>In case we required multiple restrictions to a directive we can use AEC</strong>.</p>
<h3>Scope inside a Directive</h3>
<p>Scope inside a directive gives freedom to accept out parameters from the shape of attributes. For an example let we plan to create a tab control. What I want is when I will declare my-tab directive in HTML I need to pass length as another attribute which will control the number of tabs. Here value of length is a number. To fetch this number from length attribute using scope we can declare “length”:’=’. In-case we are looking to fetch data in the shape of JSON we need to declare “data”: ‘@’. <strong>Using scope.$watch we can find out the value of an attribute in a directive</strong>.</p>
<h3>Link in a Directive</h3>
<p>Link is a function in a directive. After major parameters like scope &amp; element <strong>you can define additional parameters to a link function</strong>. If we have attributes in scope object we can <a href="https://jharaphula.com/angularjs-watch-link-function-example/" target="_blank" rel="noopener noreferrer">fetch that attribute value using scope.$watch</a>. Element is nothing but the list of DOM elements.</p>
<h3>Transclude option</h3>
<p>Sometimes it is desirable to pass an entire template rather than a string of HTML or an object. Assume a condition where we have to create a dialog box. The dialog box should be able to wrap any arbitrary content. To do this, here we need to use the Transclude option. Transclude option accepts Boolean value.</p>
<h3>Require Option</h3>
<p>Require option is a restriction to nested directives. Let we want to do a tab control with respective panels. Here in-case I need to protect panels with &amp; only with tabs then I can use require: ‘^myTabs’ under myPanel directive. While embedding in HTML we have to use myTab inside myPanel directive only.</p>
<p>For more details about Angular Custom Directive please refer the following links.</p>
<p><a href="https://docs.angularjs.org/guide/directive" target="_blank" rel="nofollow noopener noreferrer">Guide for AngularJS Directive</a><br />
<a href="http://tutorials.jenkov.com/angularjs/custom-directives.html" target="_blank" rel="noopener noreferrer nofollow">AngularJS Custom Directive in Details</a></p>
<p>The post <a href="https://jharaphula.com/angular-custom-directive-tutorial-example/">Angular Custom Directive Tutorial with Example for Beginners</a> appeared first on <a href="https://jharaphula.com">OneStop Shop</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://jharaphula.com/angular-custom-directive-tutorial-example/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			<media:content url="https://jharaphula.com/wp-content/uploads/2016/05/Directives-in-AngularJS.jpg" medium="image" />
	</item>
		<item>
		<title>How to implement AngularJS Ajax using HTTP Service?</title>
		<link>https://jharaphula.com/angularjs-ajax-http-service/</link>
					<comments>https://jharaphula.com/angularjs-ajax-http-service/#respond</comments>
		
		<dc:creator><![CDATA[Nibedita Panda]]></dc:creator>
		<pubDate>Fri, 13 May 2016 12:23:25 +0000</pubDate>
				<category><![CDATA[AngularJS with Examples]]></category>
		<category><![CDATA[Ajax Operations]]></category>
		<category><![CDATA[Angular HTTP get method]]></category>
		<category><![CDATA[HTTP Service]]></category>
		<guid isPermaLink="false">http://box.jharaphula.com/?p=517</guid>

					<description><![CDATA[<img width="300" height="190" src="https://jharaphula.com/wp-content/uploads/2016/05/blog-angular-js-laptop-300x190.jpg" class="webfeedsFeaturedVisual wp-post-image" alt="How to implement Angularjs Ajax using HTTP Service?" style="display: block; margin-bottom: 10px; clear: both; max-width: 100%;" decoding="async" loading="lazy" srcset="https://jharaphula.com/wp-content/uploads/2016/05/blog-angular-js-laptop-300x190.jpg 300w, https://jharaphula.com/wp-content/uploads/2016/05/blog-angular-js-laptop.jpg 750w" sizes="auto, (max-width: 300px) 100vw, 300px" /><p>Depending upon the demand of Ajax many languages provides the facility to operate Ajax in their platform. AngularJS is a high level programming language to...</p>
<p>The post <a href="https://jharaphula.com/angularjs-ajax-http-service/">How to implement AngularJS Ajax using HTTP Service?</a> appeared first on <a href="https://jharaphula.com">OneStop Shop</a>.</p>
]]></description>
										<content:encoded><![CDATA[<img width="300" height="190" src="https://jharaphula.com/wp-content/uploads/2016/05/blog-angular-js-laptop-300x190.jpg" class="webfeedsFeaturedVisual wp-post-image" alt="How to implement Angularjs Ajax using HTTP Service?" style="display: block; margin-bottom: 10px; clear: both; max-width: 100%;" decoding="async" loading="lazy" srcset="https://jharaphula.com/wp-content/uploads/2016/05/blog-angular-js-laptop-300x190.jpg 300w, https://jharaphula.com/wp-content/uploads/2016/05/blog-angular-js-laptop.jpg 750w" sizes="auto, (max-width: 300px) 100vw, 300px" /><p>Depending upon the demand of Ajax many languages provides the facility to operate Ajax in their platform. AngularJS is a high level programming language to optimize HTML &amp; Javascripts. AngularJS supports Ajax calls using its $http Service. In $http service using get &amp; post methods we do Ajax operations. Get is responsible to fetch data from the server while post posting the data to the server.</p>
<h3>Angular HTTP get method</h3>
<p>AngularJS $http.get() method accepts 2 parameters url &amp; configuration settings. From which server page we are going to get data that page path is the value to url param. The second param config passed to the different $http <a href="https://jharaphula.com/php-string-functions-with-example/" rel="noopener noreferrer" target="_blank">functions</a> controls the HTTP request sent to the server. Config parameter is a pure JavaScript object. It has several properties like method, url, params, headers, timeout, cache, transformRequest &amp; transformResponse.</p>
<pre class="brush: xml; title: ; notranslate">
&lt;script src=&quot;https://ajax.googleapis.com/ajax/libs/angularjs/1.2.5/angular.min.js&quot;&gt;&lt;/script&gt;
&lt;div ng-controller=&quot;MyController&quot;&gt;
&lt;button ng-click=&quot;myData.doClick(item, $event)&quot;&gt;Do an Ajax Call&lt;/button&gt;

Response from Server : {{myData.fromServer}}

&lt;/div&gt;
&lt;script&gt;&lt;br /&gt;
angular.module(&quot;myapp&quot;, [])&lt;br /&gt;
.controller(&quot;MyController&quot;, function($scope, $http) {&lt;br /&gt;
$scope.myData = {};&lt;br /&gt;
$scope.myData.doClick = function(item, event) {&lt;/p&gt;
&lt;p&gt;var response = $http.get(&quot;/AngularJSDemo/json-data.jsp&quot;);&lt;/p&gt;
&lt;p&gt;response.success(function(data, status, headers, config) {&lt;br /&gt;
$scope.myData.fromServer = data.title;&lt;br /&gt;
});&lt;br /&gt;
}&lt;br /&gt;
} );&lt;br /&gt;
&lt;/script&gt;
</pre>
<h3>Angularjs HTTP post method</h3>
<p>AngularJS $http.post() method accepts 3 parameters url, data &amp; configuration settings. To which server page we want to send our data that page path is the value to url param. Data is the value(s) those we want to pass using post method. For an example it can be the first name &amp; last name.</p>
<pre class="brush: jscript; title: ; notranslate">
function sendDataUsingPostMethod($scope) {
$http({
url: 'demo-app.php',
method: &quot;POST&quot;,
data: { 'empName' : Biswabhusan }
})
.then(function(response) {
// On Success
},
function(response) {
// On Failed
}
);
</pre>
<p>The post <a href="https://jharaphula.com/angularjs-ajax-http-service/">How to implement AngularJS Ajax using HTTP Service?</a> appeared first on <a href="https://jharaphula.com">OneStop Shop</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://jharaphula.com/angularjs-ajax-http-service/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			<media:content url="https://jharaphula.com/wp-content/uploads/2016/05/blog-angular-js-laptop.jpg" medium="image" />
	</item>
		<item>
		<title>HTML5 Table Sorting and Pagination using AngularJS</title>
		<link>https://jharaphula.com/html5-table-sorting-pagination-using-angularjs/</link>
					<comments>https://jharaphula.com/html5-table-sorting-pagination-using-angularjs/#respond</comments>
		
		<dc:creator><![CDATA[Nibedita Panda]]></dc:creator>
		<pubDate>Fri, 13 May 2016 11:53:28 +0000</pubDate>
				<category><![CDATA[AngularJS with Examples]]></category>
		<category><![CDATA[HTML5 Table Sorting]]></category>
		<category><![CDATA[Pagination using AngularJS]]></category>
		<category><![CDATA[Sorting and Pagination]]></category>
		<guid isPermaLink="false">http://box.jharaphula.com/?p=492</guid>

					<description><![CDATA[<img width="300" height="196" src="https://jharaphula.com/wp-content/uploads/2016/05/pagination-n-sorting-in-table-300x196.png" class="webfeedsFeaturedVisual wp-post-image" alt="HTML5 table Sorting &amp; Pagination using AngularJS" style="display: block; margin-bottom: 10px; clear: both; max-width: 100%;" decoding="async" loading="lazy" srcset="https://jharaphula.com/wp-content/uploads/2016/05/pagination-n-sorting-in-table-300x196.png 300w, https://jharaphula.com/wp-content/uploads/2016/05/pagination-n-sorting-in-table-182x120.png 182w, https://jharaphula.com/wp-content/uploads/2016/05/pagination-n-sorting-in-table-106x70.png 106w, https://jharaphula.com/wp-content/uploads/2016/05/pagination-n-sorting-in-table.png 750w" sizes="auto, (max-width: 300px) 100vw, 300px" /><p>To display data in a HTML document we do use table. While presenting data in a table to make this more user friendly we need...</p>
<p>The post <a href="https://jharaphula.com/html5-table-sorting-pagination-using-angularjs/">HTML5 Table Sorting and Pagination using AngularJS</a> appeared first on <a href="https://jharaphula.com">OneStop Shop</a>.</p>
]]></description>
										<content:encoded><![CDATA[<img width="300" height="196" src="https://jharaphula.com/wp-content/uploads/2016/05/pagination-n-sorting-in-table-300x196.png" class="webfeedsFeaturedVisual wp-post-image" alt="HTML5 table Sorting &amp; Pagination using AngularJS" style="display: block; margin-bottom: 10px; clear: both; max-width: 100%;" decoding="async" loading="lazy" srcset="https://jharaphula.com/wp-content/uploads/2016/05/pagination-n-sorting-in-table-300x196.png 300w, https://jharaphula.com/wp-content/uploads/2016/05/pagination-n-sorting-in-table-182x120.png 182w, https://jharaphula.com/wp-content/uploads/2016/05/pagination-n-sorting-in-table-106x70.png 106w, https://jharaphula.com/wp-content/uploads/2016/05/pagination-n-sorting-in-table.png 750w" sizes="auto, (max-width: 300px) 100vw, 300px" /><p>To display data in a HTML document we do use table. While presenting data in a table to make this more user friendly we need some minimum operations like Sorting &amp; Pagination. In this article I am using a HTML5 table to bind data using AngularJS. Including data bind here I implemented sorting &amp; pagination features. Look at the example below.</p>
<p><img loading="lazy" decoding="async" src="https://jharaphula.com/wp-content/uploads/2016/05/html-ng-table.png" alt="html-ng-table" width="725" height="232" class="alignnone size-full wp-image-2809" srcset="https://jharaphula.com/wp-content/uploads/2016/05/html-ng-table.png 725w, https://jharaphula.com/wp-content/uploads/2016/05/html-ng-table-300x96.png 300w" sizes="auto, (max-width: 725px) 100vw, 725px" /></p>
<h3>index.html</h3>
<pre class="brush: xml; title: ; notranslate">&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD HTML 4.01 Transitional//EN&quot; &quot;http://www.w3.org/TR/html4/loose.dtd&quot;&gt;
&lt;html ng-app=&quot;tblModule&quot;&gt;
&lt;head&gt;
&lt;meta charset=&quot;utf-8&quot;&gt;
&lt;title&gt;HTML5 Table Sorting &amp; Pagination using AngularJS&lt;/title&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;https://ajax.googleapis.com/ajax/libs/angularjs/1.3.0-rc.0/angular.min.js&quot; ng:autobind&gt;&lt;/script&gt;
&lt;link href=&quot;http://netdna.bootstrapcdn.com/twitter-bootstrap/2.1.1/css/bootstrap.no-icons.min.css&quot; rel=&quot;stylesheet&quot;&gt;
&lt;link href=&quot;http://netdna.bootstrapcdn.com/font-awesome/2.0/css/font-awesome.css&quot; rel=&quot;stylesheet&quot;&gt;
&lt;link rel=&quot;stylesheet&quot; href=&quot;bootstrap/css/bootstrap.min.css&quot; type=&quot;text/css&quot;&gt;
&lt;link rel=&quot;stylesheet&quot; href=&quot;bootstrap/css/bootstrap-theme.min.css&quot; type=&quot;text/css&quot;&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;app.js&quot;&gt;&lt;/script&gt;
&lt;link rel=&quot;stylesheet&quot; href=&quot;app-style.css&quot; type=&quot;text/css&quot;&gt;
&lt;script src=&quot;http://code.jquery.com/jquery-1.11.0.min.js&quot;&gt;,&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;script type=&quot;text/javascript&quot;&gt;
var sortingOrder = 'name';
&lt;/script&gt;
&lt;my-customer tbl-width=&quot;900&quot;&gt;&lt;/my-customer&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>
<h3>my-customer.html</h3>
<pre class="brush: xml; title: ; notranslate">&lt;div class=&quot;input-append&quot;&gt;
&lt;input type=&quot;text&quot; ng-model=&quot;query&quot; ng-change=&quot;search()&quot; class=&quot;input-large search-query&quot; placeholder=&quot;Search&quot;&gt;
&lt;span class=&quot;add-on&quot;&gt;&lt;i class=&quot;icon-search&quot;&gt;&lt;/i&gt;&lt;/span&gt;
&lt;/div&gt;
&lt;table class=&quot;table table-striped table-condensed table-hover&quot;&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th class=&quot;id&quot;&gt;Id&amp;nbsp;&lt;a ng-click=&quot;sort_by('id')&quot;&gt;&lt;i class=&quot;icon-sort&quot;&gt;&lt;/i&gt;&lt;/a&gt;&lt;/th&gt;
&lt;th class=&quot;name&quot;&gt;Name&amp;nbsp;&lt;a ng-click=&quot;sort_by('name')&quot;&gt;&lt;i class=&quot;icon-sort&quot;&gt;&lt;/i&gt;&lt;/a&gt;&lt;/th&gt;
&lt;th class=&quot;designation&quot;&gt;Designation&amp;nbsp;&lt;a ng-click=&quot;sort_by('designation')&quot;&gt;&lt;i class=&quot;icon-sort&quot;&gt;&lt;/i&gt;&lt;/a&gt;&lt;/th&gt;
&lt;th class=&quot;employeeid&quot;&gt;Employee ID&amp;nbsp;&lt;a ng-click=&quot;sort_by('employeeid')&quot;&gt;&lt;i class=&quot;icon-sort&quot;&gt;&lt;/i&gt;&lt;/a&gt;&lt;/th&gt;
&lt;th class=&quot;email&quot;&gt;Email&amp;nbsp;&lt;a ng-click=&quot;sort_by('email')&quot;&gt;&lt;i class=&quot;icon-sort&quot;&gt;&lt;/i&gt;&lt;/a&gt;&lt;/th&gt;
&lt;th class=&quot;location&quot;&gt;Location&amp;nbsp;&lt;a ng-click=&quot;sort_by('location')&quot;&gt;&lt;i class=&quot;icon-sort&quot;&gt;&lt;/i&gt;&lt;/a&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tfoot&gt;
&lt;td colspan=&quot;6&quot;&gt;
&lt;div class=&quot;pagination pull-right&quot;&gt;
&lt;ul&gt;
&lt;li ng-class=&quot;{disabled: currentPage == 0}&quot;&gt;
&lt;a href ng-click=&quot;prevPage()&quot;&gt;« Prev&lt;/a&gt;
&lt;/li&gt;
&lt;li ng-repeat=&quot;n in range(pagedItems.length)&quot; ng-class=&quot;{active: n == currentPage}&quot; ng-click=&quot;setPage()&quot;&gt;
&lt;a href ng-bind=&quot;n + 1&quot;&gt;1&lt;/a&gt;
&lt;/li&gt;
&lt;li ng-class=&quot;{disabled: currentPage == pagedItems.length - 1}&quot;&gt;
&lt;a href ng-click=&quot;nextPage()&quot;&gt;Next »&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;/td&gt;
&lt;/tfoot&gt;
&lt;tbody&gt;
&lt;tr ng-repeat=&quot;item in pagedItems[currentPage] | orderBy:sortingOrder:reverse&quot;&gt;
&lt;td&gt;{{ item.id }}&lt;/td&gt;
&lt;td&gt;{{ item.name }}&lt;/td&gt;
&lt;td&gt;{{ item.designation }}&lt;/td&gt;
&lt;td&gt;{{ item.employeeid }}&lt;/td&gt;
&lt;td&gt;&lt;a href=&quot;mailto:{{ item.email }}&quot;&gt;{{ item.email }}&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;{{ item.location }}&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;</pre>
<p><strong>app.js</strong></p>
<pre class="brush: jscript; title: ; notranslate">angular.module('tblModule', [])
.directive('myCustomer', function() {
return {
restrict: 'E',
transclude: true,

scope: {
&quot;tblWidth&quot;: '='
},

link: function (scope, element) {
scope.$watch(&quot;tblWidth&quot;, function (value) {
$(&quot;#tbltemp&quot;).css({&quot;width&quot;: value + &quot;px&quot;});
}, false);
},

controller: function($scope, $filter) {
$scope.sortingOrder = sortingOrder;
$scope.reverse = false;
$scope.filteredItems = [];
$scope.groupedItems = [];
$scope.itemsPerPage = 5;
$scope.pagedItems = [];
$scope.currentPage = 0;
$scope.items = [
{&quot;id&quot;:&quot;1&quot;,&quot;name&quot;:&quot;Biswabhusan&quot;,&quot;designation&quot;:&quot;Sr. UI Developer&quot;,&quot;employeeid&quot;:&quot;012801&quot;,&quot;email&quot;:&quot;biswabhusan@gmail.com&quot;,&quot;location&quot;:&quot;INDIA&quot;}, 
{&quot;id&quot;:&quot;2&quot;,&quot;name&quot;:&quot;Rakesh Srivastab&quot;,&quot;designation&quot;:&quot;Software Engineer&quot;,&quot;employeeid&quot;:&quot;013882&quot;,&quot;email&quot;:&quot;rakesh@gmail.com&quot;,&quot;location&quot;:&quot;GERMANY&quot;}, 
{&quot;id&quot;:&quot;3&quot;,&quot;name&quot;:&quot;John Fernandez&quot;,&quot;designation&quot;:&quot;Sr. Team Lead&quot;,&quot;employeeid&quot;:&quot;055620&quot;,&quot;email&quot;:&quot;john@gmail.com&quot;,&quot;location&quot;:&quot;ITALY&quot;}, 
{&quot;id&quot;:&quot;4&quot;,&quot;name&quot;:&quot;Kumar Abhishek&quot;,&quot;designation&quot;:&quot;Project Manager&quot;,&quot;employeeid&quot;:&quot;032451&quot;,&quot;email&quot;:&quot;ku.abhishek@gmail.com&quot;,&quot;location&quot;:&quot;INDIA&quot;}, 
{&quot;id&quot;:&quot;5&quot;,&quot;name&quot;:&quot;Swati Rao&quot;,&quot;designation&quot;:&quot;UI Developer&quot;,&quot;employeeid&quot;:&quot;001235&quot;,&quot;email&quot;:&quot;rao@gmail.com&quot;,&quot;location&quot;:&quot;HONG KONG&quot;}, 
{&quot;id&quot;:&quot;6&quot;,&quot;name&quot;:&quot;Monika Roy&quot;,&quot;designation&quot;:&quot;SEO&quot;,&quot;employeeid&quot;:&quot;076565&quot;,&quot;email&quot;:&quot;monika@gmail.com&quot;,&quot;location&quot;:&quot;INDIA&quot;}, 
{&quot;id&quot;:&quot;7&quot;,&quot;name&quot;:&quot;Monalisha Pradhan&quot;,&quot;designation&quot;:&quot;Sr. Software Engineer&quot;,&quot;employeeid&quot;:&quot;012302&quot;,&quot;email&quot;:&quot;monalisha@gmail.com&quot;,&quot;location&quot;:&quot;US&quot;}
];

var searchMatch = function (haystack, needle) {
if (!needle) {
return true;
}
return haystack.toLowerCase().indexOf(needle.toLowerCase()) !== -1;
};

// initializing the filtered items
$scope.search = function () {
$scope.filteredItems = $filter('filter')($scope.items, function (item) {
for(var attr in item) {
if (searchMatch(item[attr], $scope.query))
return true;
}
return false;
});
// taking care of the sorting order
if ($scope.sortingOrder !== '') {
$scope.filteredItems = $filter('orderBy')($scope.filteredItems, $scope.sortingOrder, $scope.reverse);
}
$scope.currentPage = 0;
// now group by pages
$scope.groupToPages();
};

// calculate page in place
$scope.groupToPages = function () {
$scope.pagedItems = [];

for (var i = 0; i &lt; $scope.filteredItems.length; i++) {
if (i % $scope.itemsPerPage === 0) {
$scope.pagedItems[Math.floor(i / $scope.itemsPerPage)] = [ $scope.filteredItems[i] ];
} else {
$scope.pagedItems[Math.floor(i / $scope.itemsPerPage)].push($scope.filteredItems[i]);
}
}
};

$scope.range = function (start, end) {
var ret = [];
if (!end) {
end = start;
start = 0;
}
for (var i = start; i &lt; end; i++) {
ret.push(i);
}
return ret;
};

$scope.prevPage = function () {
if ($scope.currentPage &gt; 0) {
$scope.currentPage--;
}
};

$scope.nextPage = function () {
if ($scope.currentPage &lt; $scope.pagedItems.length - 1) {
$scope.currentPage++;
}
};

$scope.setPage = function () {
$scope.currentPage = this.n;
};

// functions have been describe process the data for display
$scope.search();

// change sorting order
$scope.sort_by = function(newSortingOrder) {
if ($scope.sortingOrder == newSortingOrder)
$scope.reverse = !$scope.reverse;

$scope.sortingOrder = newSortingOrder;

// icon setup
$('th i').each(function(){
// icon reset
$(this).removeClass().addClass('icon-sort');
});
if ($scope.reverse)
$('th.'+new_sorting_order+' i').removeClass().addClass('icon-chevron-up');
else
$('th.'+new_sorting_order+' i').removeClass().addClass('icon-chevron-down');
};
},
templateUrl: 'my-customer.html'
};
});</pre>
<p><strong>app-style.css</strong></p>
<pre class="brush: css; title: ; notranslate">thead {
background-color: lightblue;
border-bottom: 2px solid black; 
cursor: pointer;    
}
.paradiv {
float: left;
width: 50%;
}
.pagination {
margin: 0px 0px !important;
}
.borderdiv {
padding: 8px;
}
.ralign {
width:100%; 
text-align:right;	
}</pre>
<p>The post <a href="https://jharaphula.com/html5-table-sorting-pagination-using-angularjs/">HTML5 Table Sorting and Pagination using AngularJS</a> appeared first on <a href="https://jharaphula.com">OneStop Shop</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://jharaphula.com/html5-table-sorting-pagination-using-angularjs/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			<media:content url="https://jharaphula.com/wp-content/uploads/2016/05/pagination-n-sorting-in-table.png" medium="image" />
	</item>
		<item>
		<title>AngularJS Grouping Data using NG-Grid</title>
		<link>https://jharaphula.com/grouping-data-in-ng-grid/</link>
					<comments>https://jharaphula.com/grouping-data-in-ng-grid/#respond</comments>
		
		<dc:creator><![CDATA[Nibedita Panda]]></dc:creator>
		<pubDate>Tue, 10 May 2016 18:06:27 +0000</pubDate>
				<category><![CDATA[AngularJS with Examples]]></category>
		<category><![CDATA[AngularJS Grouping Data]]></category>
		<category><![CDATA[NG-Grid]]></category>
		<guid isPermaLink="false">http://box.jharaphula.com/?p=225</guid>

					<description><![CDATA[<img width="300" height="185" src="https://jharaphula.com/wp-content/uploads/2016/05/angularjs-demo-application-300x185.jpg" class="webfeedsFeaturedVisual wp-post-image" alt="AngularJS Grouping Data using NG-Grid" style="display: block; margin-bottom: 10px; clear: both; max-width: 100%;" decoding="async" loading="lazy" srcset="https://jharaphula.com/wp-content/uploads/2016/05/angularjs-demo-application-300x185.jpg 300w, https://jharaphula.com/wp-content/uploads/2016/05/angularjs-demo-application.jpg 750w" sizes="auto, (max-width: 300px) 100vw, 300px" /><p>Grouping makes use of jQuery UI&#8217;s draggable feature and hence you&#8217;ll need to include JQuery UI into our application Download jQuery-UI using bower by typing...</p>
<p>The post <a href="https://jharaphula.com/grouping-data-in-ng-grid/">AngularJS Grouping Data using NG-Grid</a> appeared first on <a href="https://jharaphula.com">OneStop Shop</a>.</p>
]]></description>
										<content:encoded><![CDATA[<img width="300" height="185" src="https://jharaphula.com/wp-content/uploads/2016/05/angularjs-demo-application-300x185.jpg" class="webfeedsFeaturedVisual wp-post-image" alt="AngularJS Grouping Data using NG-Grid" style="display: block; margin-bottom: 10px; clear: both; max-width: 100%;" decoding="async" loading="lazy" srcset="https://jharaphula.com/wp-content/uploads/2016/05/angularjs-demo-application-300x185.jpg 300w, https://jharaphula.com/wp-content/uploads/2016/05/angularjs-demo-application.jpg 750w" sizes="auto, (max-width: 300px) 100vw, 300px" /><p>Grouping makes use of jQuery UI&#8217;s draggable feature and hence you&#8217;ll need to include <a href="https://jharaphula.com/jquery-string-functions/" rel="noopener noreferrer" target="_blank">JQuery</a> UI into our application Download jQuery-UI using bower by typing in the following command in the terminal :</p>
<p>bower install jquery-ui</p>
<p>Include the jquery-ui library files by adding it in the app/index.html file as follows.</p>
<pre class="brush: jscript; title: ; notranslate">&lt;script src=&quot;bower_components/jquery/jquery.js&quot;&gt;&lt;/script&gt;
&lt;script src=&quot;bower_components/jquery-ui/ui/jquery-ui.js&quot;&gt;&lt;/script&gt;
&lt;script src=&quot;bower_components/angular/angular.js&quot;&gt;&lt;/script&gt;</pre>
<p>Start with adding the new array called userType, in the app/scripts/controllers/subscribers.js file.</p>
<pre class="brush: jscript; title: ; notranslate">var subscribers= $scope.subscribers =[];
var names=[&quot;Betty&quot;,&quot;John&quot;,&quot;Peter&quot;,&quot;Jaden&quot;, &quot;Shannon&quot;];
var loyalty=[3,5,7,8,7];
var userType=[&quot;Free&quot;,&quot;Free&quot;,&quot;Premium&quot;,&quot;Premium&quot;,&quot;Premium&quot;];
var joinDate=[&quot;3/5/10&quot;,&quot;5/5/12&quot;,&quot;5/8/11&quot;,&quot;11/6/13&quot;,&quot;10/12/10&quot;];</pre>
<p>Make the corresponding changes to include the userType in our add user function as follows.</p>
<pre class="brush: jscript; title: ; notranslate">$scope.addUsers =function(i){
$scope.subscribers.push({
no:i+1,
name:names[i],
userType:userType[i],
loyalty:loyalty[i],
joinDate:joinDate[i]
});
}</pre>
<p>Also add it to the column definitions in the gridOptions settings.</p>
<pre class="brush: jscript; title: ; notranslate">$scope.gridOptions = {
data: 'subscribers',
columnDefs: [
{field:'no', displayName:'No.'},
{field:'name', displayName:'Name'},
{field:'userType', displayName:'Subscription Type'},
{field:'loyalty', displayName:'Loyalty Score'},
{field:'joinDate', displayName:'Date of Joining'}]
};</pre>
<p>Add the following two parameters to the gridOptions in app/scripts/controllers/subscribers.js as highlighted.</p>
<pre class="brush: jscript; title: ; notranslate">$scope.gridOptions = {
data: 'subscribers',
showGroupPanel: true,
jqueryUIDraggable: true,
columnDefs: [
{field:'no', displayName:'No.'},
{field:'name', displayName:'Name'},
{field:'userType', displayName:'Subscription Type'},
{field:'loyalty', displayName:'Loyalty Score'},
{field:'joinDate', displayName:'Date of Joining'}]
};</pre>
<p>Save the file and refresh the subscriptions view in your browser.</p>
<p>The post <a href="https://jharaphula.com/grouping-data-in-ng-grid/">AngularJS Grouping Data using NG-Grid</a> appeared first on <a href="https://jharaphula.com">OneStop Shop</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://jharaphula.com/grouping-data-in-ng-grid/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			<media:content url="https://jharaphula.com/wp-content/uploads/2016/05/angularjs-demo-application.jpg" medium="image" />
	</item>
		<item>
		<title>How to bind data to Angular Grid using ng-grid Directive?</title>
		<link>https://jharaphula.com/bind-data-angular-grid-ng-grid/</link>
					<comments>https://jharaphula.com/bind-data-angular-grid-ng-grid/#respond</comments>
		
		<dc:creator><![CDATA[Nibedita Panda]]></dc:creator>
		<pubDate>Tue, 10 May 2016 18:02:25 +0000</pubDate>
				<category><![CDATA[AngularJS with Examples]]></category>
		<category><![CDATA[bower install ng-grid]]></category>
		<category><![CDATA[ng-grid Directive]]></category>
		<guid isPermaLink="false">http://box.jharaphula.com/?p=222</guid>

					<description><![CDATA[<img width="300" height="200" src="https://jharaphula.com/wp-content/uploads/2016/05/selection-300x200.png" class="webfeedsFeaturedVisual wp-post-image" alt="How to bind data to Angular Grid using ng-grid Directive?" style="display: block; margin-bottom: 10px; clear: both; max-width: 100%;" decoding="async" loading="lazy" srcset="https://jharaphula.com/wp-content/uploads/2016/05/selection-300x200.png 300w, https://jharaphula.com/wp-content/uploads/2016/05/selection-182x120.png 182w, https://jharaphula.com/wp-content/uploads/2016/05/selection-106x70.png 106w, https://jharaphula.com/wp-content/uploads/2016/05/selection.png 750w" sizes="auto, (max-width: 300px) 100vw, 300px" /><p>NG-Grid is not a part of Angular Bootstrap and needs to be added separately. To install Angular Grid use bower to download the components for...</p>
<p>The post <a href="https://jharaphula.com/bind-data-angular-grid-ng-grid/">How to bind data to Angular Grid using ng-grid Directive?</a> appeared first on <a href="https://jharaphula.com">OneStop Shop</a>.</p>
]]></description>
										<content:encoded><![CDATA[<img width="300" height="200" src="https://jharaphula.com/wp-content/uploads/2016/05/selection-300x200.png" class="webfeedsFeaturedVisual wp-post-image" alt="How to bind data to Angular Grid using ng-grid Directive?" style="display: block; margin-bottom: 10px; clear: both; max-width: 100%;" decoding="async" loading="lazy" srcset="https://jharaphula.com/wp-content/uploads/2016/05/selection-300x200.png 300w, https://jharaphula.com/wp-content/uploads/2016/05/selection-182x120.png 182w, https://jharaphula.com/wp-content/uploads/2016/05/selection-106x70.png 106w, https://jharaphula.com/wp-content/uploads/2016/05/selection.png 750w" sizes="auto, (max-width: 300px) 100vw, 300px" /><p>NG-Grid is not a part of Angular Bootstrap and needs to be added separately. To install <a href="https://jharaphula.com/category/programming-solutions/learn-angularjs-with-examples/" target="_blank" rel="noopener noreferrer">Angular</a> Grid use bower to download the components for ng-grid. In your terminal navigate to your project folder, and type in the following commands.</p>
<p><em>bower install ng-grid</em></p>
<p>You should now be able to see the ng-grid folder and the files within the bower_components folder. The next thing is to include the ng-grid JS and CSS files in our index.html.</p>
<p>Please add the following highlighted line in your app/index.html file to include the ng-grid CSS file.</p>
<pre class="brush: xml; title: ; notranslate">&lt;link rel=&quot;stylesheet&quot; href=&quot;styles/bootstrap.css&quot;&gt;
&lt;link rel=&quot;stylesheet&quot; href=&quot;bower_components/ng-grid/ng-grid.css&quot;&gt;
&lt;link rel=&quot;stylesheet&quot; href=&quot;styles/main.css&quot;&gt;</pre>
<h3>Add the ng-grid JS file as highlighted</h3>
<pre class="brush: xml; title: ; notranslate">&lt;script src=&quot;bower_components/jquery/jquery.js&quot;&gt;&lt;/script&gt;
&lt;script src=&quot;bower_components/angular/angular.js&quot;&gt;&lt;/script&gt;
&lt;script src=&quot;bower_components/angular-bootstrap/ui-bootstrap-tpls.js&quot;&gt;&lt;/script&gt;
&lt;script src=&quot;bower_components/ng-grid/ng-grid-2.0.7.min.js&quot;&gt;&lt;/script&gt;</pre>
<p>Next you need to add the ngGrid dependency to your AngularApp, you&#8217;ll do this by adding in your app/scripts/app.js file as highlighted.</p>
<pre class="brush: jscript; title: ; notranslate">angular.module(AngularApp, ['ui.bootstrap','ngGrid'])</pre>
<p>Now that you have NG-Grid added to your projects, create the routes, controllers, and partials for the subscribers page.</p>
<p>Open up the terminal and run the following command.</p>
<p><em>yo angular:route subscribers</em></p>
<p>Once you are done with this, you are all set to start working on your Subscribers view.</p>
<p>Open the app/scripts/controllers/subscribers.js file and create your model as follows:</p>
<pre class="brush: jscript; title: ; notranslate">$scope.subscribers =[];
var names=[&quot;Betty&quot;,&quot;John&quot;,&quot;Peter&quot;,&quot;Jaden&quot;, &quot;Shannon&quot;];
var loyalty=[3,5,7,8,7];
var joinDate=[&quot;3/5/10&quot;,&quot;5/5/12&quot;,&quot;5/8/11&quot;,&quot;11/6/13&quot;,&quot;10/12/10&quot;];</pre>
<p>Delete the awesomeThings model and initialize the subscribers model and create the arrays for names, loyalty and joinDate.</p>
<p>Next create a function that will add push the data into the subscribers model.</p>
<pre class="brush: jscript; title: ; notranslate">$scope.addUsers =function(i){
$scope.subscribers.push({
no:i+1,
name:names[i],
loyalty:loyalty[i],
joinDate:joinDate[i]
});
}</pre>
<p>And finally run a for loop that iterates through the array elements and adds them to the model.</p>
<pre class="brush: jscript; title: ; notranslate">for (var i=0;i&lt;5;i++){
$scope.addUsers(i);
}</pre>
<p>Now that the model is ready, you need to initialize the NG-Grid, so after the for loop lets initialize the ng-grid as follows:</p>
<pre class="brush: jscript; title: ; notranslate">$scope.gridOptions = {
data: 'subscribers'
};</pre>
<p>Your work on the controller is done, let&#8217;s open the app/views/subscribers.html partial and add the markup for the Grid.</p>
<pre class="brush: xml; title: ; notranslate">&lt;h1&gt;Subscribers&lt;/h1&gt;
&lt;div class=&quot;gridStyles&quot; ng-grid=&quot;gridOptions&quot;&gt;
&lt;/div&gt;</pre>
<p>add the height and width properties to the .gridStyles class.</p>
<pre class="brush: css; title: ; notranslate">.gridStyles{
width:940px;
height:300px;</pre>
<p>To add the Column Definitions open the app/scripts/controllers/subscribers.js file, and add the following code as highlighted below:</p>
<pre class="brush: jscript; title: ; notranslate">$scope.gridOptions = {
data: 'subscribers',
showGroupPanel: true,
jqueryUIDraggable: true,
enableCellSelection: true,
enableRowSelection: false,
enableCellEdit: true,
columnDefs: [
{field:'no', displayName:'No.'},
{field:'name', displayName:'Name'},
{field:'userType', displayName:'Subscription Type'},
{field:'loyalty', displayName:'Loyalty Score'},
{field:'joinDate', displayName:'Date of Joining'}
]
};</pre>
<p>For alternating row colors simply over riding the default odd and even row classes by adding the following classes to the app/styles/main.css file.</p>
<pre class="brush: css; title: ; notranslate">.ngRow.even {
background: #eaeaff;
}
.ngRow.odd {
background: #eaffea;
}</pre>
<p>The post <a href="https://jharaphula.com/bind-data-angular-grid-ng-grid/">How to bind data to Angular Grid using ng-grid Directive?</a> appeared first on <a href="https://jharaphula.com">OneStop Shop</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://jharaphula.com/bind-data-angular-grid-ng-grid/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			<media:content url="https://jharaphula.com/wp-content/uploads/2016/05/selection.png" medium="image" />
	</item>
		<item>
		<title>Angular Modal Window Example using $modal.open Method</title>
		<link>https://jharaphula.com/angular-modal-window-example/</link>
					<comments>https://jharaphula.com/angular-modal-window-example/#respond</comments>
		
		<dc:creator><![CDATA[Nibedita Panda]]></dc:creator>
		<pubDate>Tue, 10 May 2016 17:46:13 +0000</pubDate>
				<category><![CDATA[AngularJS with Examples]]></category>
		<category><![CDATA[Angular Modal Window]]></category>
		<category><![CDATA[Modal Window Example]]></category>
		<guid isPermaLink="false">http://box.jharaphula.com/?p=210</guid>

					<description><![CDATA[<img width="300" height="200" src="https://jharaphula.com/wp-content/uploads/2016/05/simple-modal-window-300x200.png" class="webfeedsFeaturedVisual wp-post-image" alt="Angular Modal Window Example using $modal.open Method" style="display: block; margin-bottom: 10px; clear: both; max-width: 100%;" decoding="async" loading="lazy" srcset="https://jharaphula.com/wp-content/uploads/2016/05/simple-modal-window-300x200.png 300w, https://jharaphula.com/wp-content/uploads/2016/05/simple-modal-window-182x120.png 182w, https://jharaphula.com/wp-content/uploads/2016/05/simple-modal-window-106x70.png 106w, https://jharaphula.com/wp-content/uploads/2016/05/simple-modal-window.png 750w" sizes="auto, (max-width: 300px) 100vw, 300px" /><p>Create a modal window with a form to add users to our subscribers model. You will need a button which will launch the modal window...</p>
<p>The post <a href="https://jharaphula.com/angular-modal-window-example/">Angular Modal Window Example using $modal.open Method</a> appeared first on <a href="https://jharaphula.com">OneStop Shop</a>.</p>
]]></description>
										<content:encoded><![CDATA[<img width="300" height="200" src="https://jharaphula.com/wp-content/uploads/2016/05/simple-modal-window-300x200.png" class="webfeedsFeaturedVisual wp-post-image" alt="Angular Modal Window Example using $modal.open Method" style="display: block; margin-bottom: 10px; clear: both; max-width: 100%;" decoding="async" loading="lazy" srcset="https://jharaphula.com/wp-content/uploads/2016/05/simple-modal-window-300x200.png 300w, https://jharaphula.com/wp-content/uploads/2016/05/simple-modal-window-182x120.png 182w, https://jharaphula.com/wp-content/uploads/2016/05/simple-modal-window-106x70.png 106w, https://jharaphula.com/wp-content/uploads/2016/05/simple-modal-window.png 750w" sizes="auto, (max-width: 300px) 100vw, 300px" /><p>Create a modal window with a form to add users to our subscribers model. You will need a button which will launch the modal window when clicked. So create button in the app/views/subscribers.html as highlighted below:</p>
<pre class="brush: xml; title: ; notranslate">&lt;h3&gt;Subscribers&lt;/h3&gt;
&lt;button class=&quot;btn btn-success&quot; ng-click=&quot;showModal()&quot;&gt; Add New User&lt;/button&gt;
&lt;div class=&quot;gridStyles&quot; ng-grid=&quot;gridOptions&quot;&gt;
&lt;/div&gt;</pre>
<p>now create the partial for the modal view.</p>
<p>Create a new file called add-user.html within the app/views folder and let&#8217;s put in the markup for the Add User Form as follows:</p>
<pre class="brush: xml; title: ; notranslate">&lt;div class=&quot;modal-header&quot;&gt;
&lt;button type=&quot;button&quot; class=&quot;close&quot; ng-click=&quot;cancel()&quot; datadismiss=&quot;modal&quot; aria-hidden=&quot;true&quot;&gt;&amp;times;&lt;/button&gt;
&lt;h3&gt;Add a Subscriber&lt;/h3&gt;
&lt;/div&gt;</pre>
<p>Next markup the content for the modal body</p>
<pre class="brush: xml; title: ; notranslate">&lt;div class=&quot;modal-body&quot;&gt;
&lt;label&gt;Name&lt;/label&gt;&lt;input type=&quot;text&quot; ng-model=&quot;newUser.name&quot;/&gt;
&lt;label&gt;Subscription Type&lt;/label&gt;&lt;input type=&quot;text&quot; ng-model=&quot;newUser.userType&quot;/&gt;
&lt;label&gt;Loyalty Score&lt;/label&gt;&lt;input type=&quot;number&quot; ng-model=&quot;newUser.loyalty&quot;/&gt;
&lt;label&gt;Date of Joining&lt;/label&gt;&lt;input type=&quot;date&quot;ng-model=&quot;newUser.joinDate&quot;/&gt;
&lt;br/&gt;
&lt;button class=&quot;btn btn-success&quot; ng-click=&quot;saveNewUser()&quot;&gt; Save User&lt;/button&gt;
&lt;/div&gt;</pre>
<p>Next add the code to your app/scripts/controllers/subscribers.js file as follows:</p>
<p>The Modal window makes use of the $modal service, so we will need to add it to our SubscribersCtrl as highlighted :</p>
<pre class="brush: jscript; title: ; notranslate">angular.module('hlApp')
.controller('SubscribersCtrl', function ($scope, $modal) {</pre>
<p>Next write the code to call the modal window.</p>
<p>Since the &#8216;Add New User&#8217; will call the showModal function when clicked you will define that <a href="https://jharaphula.com/php-string-functions-with-example/" rel="noopener noreferrer" target="_blank">function</a> at the end, just above the closing braces of your Subscribers Ctrl controller as follows:</p>
<pre class="brush: jscript; title: ; notranslate">$scope.showModel=function () {
$scope.newUser={};
var modalInstance = $modal.open({
templateUrl: 'views/add-user.html'})}</pre>
<p>Another option that the $modal.open method supports is the &#8216;controller&#8217; which allows you to assign a controller that binds to the view within the modal. Now add the controller option to your modalInstance.</p>
<pre class="brush: jscript; title: ; notranslate">$scope.showModal=function () {
$scope.newUser={};
var modalInstance = $modal.open({
templateUrl: 'views/add-user.html',
controller:'AddNewUserCtrl'
})}</pre>
<p>Next create your AddNewUserCtrl within the same app/scripts/controllers/subscribers.js file.<br />
Add this controller right at the end of the file after the SubscribersCtrl function ends.</p>
<pre class="brush: jscript; title: ; notranslate">.controller('AddNewUserCtrl', function ($scope, $modalInstance) {
});</pre>
<p>Now within the AddNewUserCtrl define the functions for the cancel button as follows:</p>
<pre class="brush: jscript; title: ; notranslate">.controller('AddNewUserCtrl', function ($scope, $modalInstance) {
$scope.cancel =function(){
$modalInstance.dismiss('cancel');
}
});</pre>
<p>Save the files and check to see if the Add New User and the cancel buttons are working.</p>
<p>The post <a href="https://jharaphula.com/angular-modal-window-example/">Angular Modal Window Example using $modal.open Method</a> appeared first on <a href="https://jharaphula.com">OneStop Shop</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://jharaphula.com/angular-modal-window-example/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			<media:content url="https://jharaphula.com/wp-content/uploads/2016/05/simple-modal-window.png" medium="image" />
	</item>
		<item>
		<title>Building Image Gallery using AngularJS</title>
		<link>https://jharaphula.com/building-image-gallery-using-angularjs/</link>
					<comments>https://jharaphula.com/building-image-gallery-using-angularjs/#respond</comments>
		
		<dc:creator><![CDATA[Nibedita Panda]]></dc:creator>
		<pubDate>Tue, 10 May 2016 17:44:11 +0000</pubDate>
				<category><![CDATA[AngularJS with Examples]]></category>
		<category><![CDATA[Building Image Gallery]]></category>
		<category><![CDATA[Gallery using AngularJS]]></category>
		<guid isPermaLink="false">http://box.jharaphula.com/?p=208</guid>

					<description><![CDATA[<img width="300" height="179" src="https://jharaphula.com/wp-content/uploads/2016/05/ng-image-gallery-300x179.png" class="webfeedsFeaturedVisual wp-post-image" alt="Building Image Gallery using AngularJS" style="display: block; margin-bottom: 10px; clear: both; max-width: 100%;" decoding="async" loading="lazy" srcset="https://jharaphula.com/wp-content/uploads/2016/05/ng-image-gallery-300x179.png 300w, https://jharaphula.com/wp-content/uploads/2016/05/ng-image-gallery.png 750w" sizes="auto, (max-width: 300px) 100vw, 300px" /><p>To build your Image Gallery using AngularJS, let&#8217;s create the controller, partial and routes for it using the yeoman command as follows : yo angular:route...</p>
<p>The post <a href="https://jharaphula.com/building-image-gallery-using-angularjs/">Building Image Gallery using AngularJS</a> appeared first on <a href="https://jharaphula.com">OneStop Shop</a>.</p>
]]></description>
										<content:encoded><![CDATA[<img width="300" height="179" src="https://jharaphula.com/wp-content/uploads/2016/05/ng-image-gallery-300x179.png" class="webfeedsFeaturedVisual wp-post-image" alt="Building Image Gallery using AngularJS" style="display: block; margin-bottom: 10px; clear: both; max-width: 100%;" decoding="async" loading="lazy" srcset="https://jharaphula.com/wp-content/uploads/2016/05/ng-image-gallery-300x179.png 300w, https://jharaphula.com/wp-content/uploads/2016/05/ng-image-gallery.png 750w" sizes="auto, (max-width: 300px) 100vw, 300px" /><p>To build your Image Gallery using AngularJS, let&#8217;s create the controller, partial and routes for it using the yeoman command as follows :</p>
<h3>yo angular:route gallery</h3>
<p>We will start with creating our model in the app/scripts/controllers/gallery.js file. Start with defining the various variables and arrays that we will need, within the GalleryCtrl controller function :</p>
<pre class="brush: jscript; title: ; notranslate">var pictures =$scope.pictures=[];
var baseURL=&quot;http://lorempixel.com/300/180/&quot;;
var titles=[&quot;Healthy Food&quot;,&quot;Healthy @ Work&quot;,&quot;City Life &quot;, &quot;Staying Fit&quot;,&quot;Looking Good&quot;,&quot;Nightlife !!&quot;] ;
var keywords=[&quot;food&quot;, &quot;business&quot;,&quot;city&quot;,&quot;sports&quot;,&quot;fashion&quot;, &quot;nightlife&quot;];
var dummyText=&quot;Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed sed erat turpis. Integer eget consectetur quam. Sed at quam ut dolor varius condimentum et sit amet odio. &quot;</pre>
<p>First you declare an empty model called pictures.</p>
<p>The next variable you define is the baseURL that holds the base URL for the images that you will show in the image gallery, as you can notice in this case you are using images of width 300 and height 180.</p>
<p>Next, Array titles is the array containing the titles for all the images.</p>
<p>The keywords array holds the list of all the keywords that you will concatenate at the end of the baseURL to get relevant images for the gallery.</p>
<p>And finally the variable dummyText holds some lorem ipsum that we will add as a description to each of the gallery images.</p>
<p>Now that you have all the variables and arrays defined the next step is to create the function that will push them into the pictures model.</p>
<h3>You will write this as follows</h3>
<pre class="brush: jscript; title: ; notranslate">$scope.addPics=function(i){
pictures.push({
url:baseURL+keywords[i],
title:titles[i],
summary:dummyText
})
}</pre>
<p>The addPics <a href="https://jharaphula.com/php-string-functions-with-example/" rel="noopener noreferrer" target="_blank">function</a> takes in an input parameter &#8216;i&#8217; which does an array push by iterating through the arrays and updating the values for the url, title and summary properties.</p>
<p>The final step here is to call the addPics function in a loop, incrementing the value of &#8216;i&#8217; .</p>
<h3>This is done as follows</h3>
<pre class="brush: jscript; title: ; notranslate">for (var i=0;i&amp;lt;5;i++){
$scope.addPics(i);
}</pre>
<p>Since for this example we need about six images we run a for loop iterating from 0 to 5. This completes our work on the controller.</p>
<p>The post <a href="https://jharaphula.com/building-image-gallery-using-angularjs/">Building Image Gallery using AngularJS</a> appeared first on <a href="https://jharaphula.com">OneStop Shop</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://jharaphula.com/building-image-gallery-using-angularjs/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			<media:content url="https://jharaphula.com/wp-content/uploads/2016/05/ng-image-gallery.png" medium="image" />
	</item>
		<item>
		<title>Getting Started with AngularJS for absolute Beginners</title>
		<link>https://jharaphula.com/getting-started-with-angularjs-for-absolute-beginners/</link>
					<comments>https://jharaphula.com/getting-started-with-angularjs-for-absolute-beginners/#respond</comments>
		
		<dc:creator><![CDATA[Biswabhusan Panda]]></dc:creator>
		<pubDate>Tue, 10 May 2016 13:25:37 +0000</pubDate>
				<category><![CDATA[AngularJS with Examples]]></category>
		<category><![CDATA[AngularJS]]></category>
		<category><![CDATA[AngularJS for absolute Beginners]]></category>
		<category><![CDATA[Google APIs]]></category>
		<category><![CDATA[HTML Vocabulary]]></category>
		<category><![CDATA[JavaScript Framework]]></category>
		<guid isPermaLink="false">http://box.jharaphula.com/?p=101</guid>

					<description><![CDATA[<img width="300" height="190" src="https://jharaphula.com/wp-content/uploads/2016/05/Angular-JS-300x190.jpg" class="webfeedsFeaturedVisual wp-post-image" alt="Getting Started with AngularJS for absolute Beginners" style="display: block; margin-bottom: 10px; clear: both; max-width: 100%;" decoding="async" loading="lazy" srcset="https://jharaphula.com/wp-content/uploads/2016/05/Angular-JS-300x190.jpg 300w, https://jharaphula.com/wp-content/uploads/2016/05/Angular-JS-768x486.jpg 768w, https://jharaphula.com/wp-content/uploads/2016/05/Angular-JS-1024x648.jpg 1024w, https://jharaphula.com/wp-content/uploads/2016/05/Angular-JS.jpg 1413w" sizes="auto, (max-width: 300px) 100vw, 300px" /><p>AngularJS is a JavaScript framework to enhance static HTML. AngularJS is designed by Google. Google says &#8220;AngularJS is a Superheroic JavaScript MVC (Model-View-Controller) Framework&#8221;. Using...</p>
<p>The post <a href="https://jharaphula.com/getting-started-with-angularjs-for-absolute-beginners/">Getting Started with AngularJS for absolute Beginners</a> appeared first on <a href="https://jharaphula.com">OneStop Shop</a>.</p>
]]></description>
										<content:encoded><![CDATA[<img width="300" height="190" src="https://jharaphula.com/wp-content/uploads/2016/05/Angular-JS-300x190.jpg" class="webfeedsFeaturedVisual wp-post-image" alt="Getting Started with AngularJS for absolute Beginners" style="display: block; margin-bottom: 10px; clear: both; max-width: 100%;" decoding="async" loading="lazy" srcset="https://jharaphula.com/wp-content/uploads/2016/05/Angular-JS-300x190.jpg 300w, https://jharaphula.com/wp-content/uploads/2016/05/Angular-JS-768x486.jpg 768w, https://jharaphula.com/wp-content/uploads/2016/05/Angular-JS-1024x648.jpg 1024w, https://jharaphula.com/wp-content/uploads/2016/05/Angular-JS.jpg 1413w" sizes="auto, (max-width: 300px) 100vw, 300px" /><p>AngularJS is a JavaScript framework to enhance static HTML. AngularJS is designed by Google. Google says “<strong>AngularJS is a Superheroic JavaScript MVC (Model-View-Controller) Framework</strong>”. Using AngularJS you can extend your HTML vocabulary. Creating <a href="https://jharaphula.com/restrict-option-custom-directive/" target="_blank" rel="noopener noreferrer">directives is an advanced feature</a> of AngularJS. Use of directives in AngularJS help to improve reuse of Codes. Controller is an another feature of AngularJS. Inside the controller AngularJS provides $scope. Which is accessible to HTML. AngularJS is easy &amp; quick to Develop.</p>
<h3>How to integrate AngularJS Library?</h3>
<p>Look at the codes below here we created a Hello World program using AngularJS.</p>
<pre class="brush: xml; title: ; notranslate">
&lt;script src=&quot;https://ajax.googleapis.com/ajax/libs/angularjs/1.3.0-beta.7/angular.min.js&quot;&gt;&lt;/script&gt;
&lt;div&gt;
&lt;label&gt;Country&lt;/label&gt;
&lt;input type=&quot;text&quot; ng-model=&quot;CountryName&quot; placeholder=&quot;Enter your Country Name here…&quot;&gt;

&lt;hr&gt;

&lt;h3&gt;Hello {{ CountryName}}!&lt;/h3&gt;
&lt;/div&gt;
</pre>
<p>The AngularJS library here we referred from Google API’s.</p>
<h3>Why to use AngularJS?</h3>
<p>When there are so many JavaScript frameworks available in the market why I will choose AngularJS?</p>
<p><strong>1.</strong> Other frameworks deal with HTML’s shortcomings by providing an imperative way for manipulating the DOM using JavaScript.</p>
<p><strong>2.</strong> Neither address the root problem that HTML was not designed for dynamic views.</p>
<p><strong>3.</strong> HTML is great for static web pages, but HTML fails to provide dynamic views in web-applications.</p>
<p><strong>4.</strong> AngularJS lets you extend HTML Vocabulary.</p>
<p><strong>5.</strong> The resulting environment is extraordinarily expressive, readable, &amp; quick to develop.</p>
<h3>Can AngularJS used with other libraries?</h3>
<p>Yes. It is fully extensible &amp; works well with other libraries. For an example Jquery, Bootstrap or Foundation like other layout frameworks.</p>
<p>for more information&#8217;s in AngularJS, please visit <a href="https://angularjs.org" target="_blank" rel="noopener noreferrer nofollow">https://angularjs.org</a></p>
<p>The post <a href="https://jharaphula.com/getting-started-with-angularjs-for-absolute-beginners/">Getting Started with AngularJS for absolute Beginners</a> appeared first on <a href="https://jharaphula.com">OneStop Shop</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://jharaphula.com/getting-started-with-angularjs-for-absolute-beginners/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			<media:content url="https://jharaphula.com/wp-content/uploads/2016/05/Angular-JS-1024x648.jpg" medium="image" />
	</item>
		<item>
		<title>Example of Angular Custom Filter to Reverse a String</title>
		<link>https://jharaphula.com/example-angular-custom-filter/</link>
					<comments>https://jharaphula.com/example-angular-custom-filter/#respond</comments>
		
		<dc:creator><![CDATA[Biswabhusan Panda]]></dc:creator>
		<pubDate>Tue, 10 May 2016 12:56:28 +0000</pubDate>
				<category><![CDATA[AngularJS with Examples]]></category>
		<category><![CDATA[Angular Custom Filter]]></category>
		<category><![CDATA[AngularJS Library]]></category>
		<category><![CDATA[Example of Angular]]></category>
		<category><![CDATA[Filter to Reverse a String]]></category>
		<guid isPermaLink="false">http://box.jharaphula.com/?p=93</guid>

					<description><![CDATA[<img width="300" height="189" src="https://jharaphula.com/wp-content/uploads/2016/05/angularjs-string-operation-300x189.jpg" class="webfeedsFeaturedVisual wp-post-image" alt="Example of Angular Custom Filter to Reverse a String" style="display: block; margin-bottom: 10px; clear: both; max-width: 100%;" decoding="async" loading="lazy" srcset="https://jharaphula.com/wp-content/uploads/2016/05/angularjs-string-operation-300x189.jpg 300w, https://jharaphula.com/wp-content/uploads/2016/05/angularjs-string-operation.jpg 750w" sizes="auto, (max-width: 300px) 100vw, 300px" /><p>A filter is a way to format the value of an expression to the required shape. By default AngularJS provides many filters like currency, date,...</p>
<p>The post <a href="https://jharaphula.com/example-angular-custom-filter/">Example of Angular Custom Filter to Reverse a String</a> appeared first on <a href="https://jharaphula.com">OneStop Shop</a>.</p>
]]></description>
										<content:encoded><![CDATA[<img width="300" height="189" src="https://jharaphula.com/wp-content/uploads/2016/05/angularjs-string-operation-300x189.jpg" class="webfeedsFeaturedVisual wp-post-image" alt="Example of Angular Custom Filter to Reverse a String" style="display: block; margin-bottom: 10px; clear: both; max-width: 100%;" decoding="async" loading="lazy" srcset="https://jharaphula.com/wp-content/uploads/2016/05/angularjs-string-operation-300x189.jpg 300w, https://jharaphula.com/wp-content/uploads/2016/05/angularjs-string-operation.jpg 750w" sizes="auto, (max-width: 300px) 100vw, 300px" /><p>A filter is a way to format the value of an expression to the required shape. By default AngularJS provides many filters like currency, date, json, limitTo, lowercase, number, orderBy &amp; uppercase. You can also create your own Custom Filters. Let us talk about the below Example. Here I Created an angular custom filter to Reverse a String. Let me explain the program how it is working.</p>
<h2>Example of Angular Custom Filter</h2>
<p>First to add AngularJS library I added script tag with Google API file &#8220;angular.min.js&#8221;. By referring this with ng-app tag in my html page I made integrated <a href="https://jharaphula.com/angularjs-assessment-questionnaires/" target="_blank" rel="noopener noreferrer">AngularJS Framework</a> to my App. Next I Created an AngularJS module named as &#8220;DemoApp&#8221;. To create a module in AngularJS I used angular.module Syntax. This is assigned to html body tag using ng-app from AngularJS. It says the body tag is in the scope of module.</p>
<p>In my page I have a simple input control. What I want is on adding text in this input box I want to display the input value in both the order original &amp; reverse order. After created the module, I added a filter method from AngularJS. Which accepts 2 parameters. The first parameter is name of the Custom Filter &amp; the Second one is the Function which return a Function with result of reverse input.</p>
<p>Using charAt, I am printing the index characters and concatenating result with this as a return result. In html body part finally I am calling our reverse custom filter for Filtered Value. The syntax is as below.</p>
<p>{{ text | reverse }}</p>
<p>&#8211; Copy this Code to Notepad.<br />
&#8211; Save this as a html file. Open this in your Browser.</p>
<h2>AngularJS Demo App to Reverse a String</h2>
<pre class="brush: xml; title: ; notranslate">
&lt;meta charset=&quot;UTF-8&quot;&gt;
&lt;title&gt;Using Custom Filter to Reverse a String in AngularJS&lt;/title&gt;
&lt;script src=&quot;https://ajax.googleapis.com/ajax/libs/angularjs/1.2.15/angular.min.js&quot;&gt;&lt;/script&gt;

&lt;script type=&quot;text/javascript&quot;&gt;&lt;/p&gt;
&lt;p&gt;var app = angular.module(&quot;DemoApp&quot;, []);&lt;/p&gt;
&lt;p&gt;app.filter(&quot;reverse&quot;, function() {&lt;br /&gt;
return function(input) {&lt;br /&gt;
var result = &quot;&quot;;&lt;br /&gt;
input = input || &quot;&quot;;&lt;br /&gt;
for (var i=0; i&lt;input.length; i++) {
result = input.charAt(i) + result;
}
return result;
};
});

&lt;/script&gt;


&lt;input type=&quot;text&quot; ng-model=&quot;text&quot; placeholder=&quot;Enter your inputs here...&quot;&gt;

Input Value : {{ text }}

Filtered Value : {{ text | reverse }}
</pre>
<p>The post <a href="https://jharaphula.com/example-angular-custom-filter/">Example of Angular Custom Filter to Reverse a String</a> appeared first on <a href="https://jharaphula.com">OneStop Shop</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://jharaphula.com/example-angular-custom-filter/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			<media:content url="https://jharaphula.com/wp-content/uploads/2016/05/angularjs-string-operation.jpg" medium="image" />
	</item>
	</channel>
</rss>
