Use Case
1. Display the list of topics available in www.kswaughs.com 2. Allows user to enter the topic and prints error message if topic is not available 3. Make a rest service call with GET method and print titles of requested topic blog posts
HTML & AngularJS code
<!doctype html> <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.5/angular.min.js"></script> <script> var app = angular.module('AngularRestApp', []); app.controller('restExample', function($scope, $http) { $scope.topics = [ 'Java', 'Camel', 'Apache-CXF', 'Junit', 'REST', 'spring' ]; $scope.submit = function() { if ($scope.topics.indexOf($scope.topic) == -1) { $scope.error = 'Entered Topic is Not available.' + ' Also, It is a Case sensitive'; } else { $scope.error = ''; $scope.getBlogPosts(); } }; $scope.getBlogPosts = function() { $http.get( "http://www.kswaughs.com/feeds/posts/summary/-/" + $scope.topic + "?alt=json").then( function(response) { $scope.myData = response.data.feed.entry; $scope.myPost = $scope.topic; }); }; }); </script> </head> <body> <div ng-app="AngularRestApp" ng-controller="restExample"> <b>List of topics available in www.kswaughs.com</b> <ul> <li ng-repeat="x in topics">{{$index+1}} {{x}}</li> </ul> <br/> <label>Topic:</label> <input type="text" ng-model="topic" placeholder="Enter topic here"> <input type="button" value="Get Posts" ng-click="submit()" /> <p ng-bind="error" style="color:red"></p> <hr /> <p> <b>Posts of {{myPost}} </b> </p> <ul> <li ng-repeat="entry in myData"> <a ng-repeat="link in entry.link | filter:{rel: 'alternate'}" href="{{link.href}}">{{entry.title.$t}}</a> </li> </ul> </div> </body> </html>
DEMO
List of topics available in www.kswaughs.com
- {{$index+1}} {{x}}
Posts of {{myPost}}
The blog you presented was very nice and interesting which helped me to get update on the recent technologies.
ReplyDeleteAngularjs training in chennai | Angularjs course in Chennai
IEEE Final Year projects India Project Centers in India are consistently sought after. Final Year Students Projects take a shot at them to improve their aptitudes, while specialists like the enjoyment in interfering with innovation. For experts, it's an alternate ball game through and through. Smaller than expected IEEE Final Year project centers ground for all fragments of CSE & IT engineers hoping to assemble. Final Year Projects for CSE It gives you tips and rules that is progressively critical to consider while choosing any final year project point.
DeleteSpring Framework has already made serious inroads as an integrated technology stack for building user-facing applications. Spring Framework Corporate TRaining the authors explore the idea of using Java in Big Data platforms.
Specifically, Spring Framework provides various tasks are geared around preparing data for further analysis and visualization. Spring Training in Chennai
The Nodejs Training Angular Training covers a wide range of topics including Components, Angular Directives, Angular Services, Pipes, security fundamentals, Routing, and Angular programmability. The new Angular TRaining will lay the foundation you need to specialise in Single Page Application developer. Angular Training
Your examples looking like expert advice buddy. Thanks for the post. AngularJS Training in Chennai | AngularJS Training
ReplyDeleteYour Blog is really amazing with smart content..Thanks for sharing this interesting Blog..
ReplyDeleteITIL Certification Exam Center in Chennai | ITIL Certification Training in Chennai
the article is very good and useful
ReplyDeleteFinal Year Project Center in Chennai | Best Project Center in Chennai | No.1 Final Year Project Center in Chennai | Best Project Center in Velachery
Well Said, you have furnished the right information that will be useful to anyone at all time. Thanks for sharing your Ideas.
ReplyDeleteWeb Designing Training Institute in Chennai | DotNet Training Institute in Chennai | Java Training Institute in Chennai
There are so many useful information in your post, I like it all the time. And I want to share this boost app ranking with you, you can take a look. This is very useful.
ReplyDeleteNeat and fruitful presentation!! I thouroughly enjoyed your article. I was searching the post like you wrote. Thanks for your sharing!!
ReplyDeleteHadoop Training in Chennai
Hadoop Course in Chennai
German Language Classes in Chennai
Big Data Course in Chennai
Java Course in Chennai
Hadoop Training in Adyar
Big Data Training in Chennai
pretty post..! This content is very helpful for developing my knowledge and I want additional information about this topic. Please posting and sharing with us...
ReplyDeleteSpark Training in Chennai
Spark Training
Pega Training in Chennai
Primavera Training in Chennai
Embedded System Course Chennai
Linux Training in Chennai
Power BI Training in Chennai
Corporate Training in Chennai
Unix Training in Chennai
I am really enjoying reading your well-written articles. It looks like you spend a lot of effort and time on your blog. I have bookmarked it and I am looking forward to reading new articles. Keep up the good work.
ReplyDeleteVMware Training in Chennai
VMware Training
Vmware cloud certification
R Training in Chennai
RPA Training in Chennai
DevOps certification in Chennai
VMWare Training in Anna Nagar
VMWare Training in T Nagar
VMWare Training in Adyar
Good job! Fruitful article. I like this very much. It is very useful for my research. It shows your interest in this topic very well. I hope you will post some more information about the software. Please keep sharing!!
ReplyDeleteSEO Training in Chennai
SEO Training in Bangalore
SEO Training in Coimbatore
SEO Training in Madurai
SEO Course in Chennai
SEO Course in Chennai
SEO Course in Bangalore
SEO Course in Coimbatore
Nice article. I liked very much. All the informations given by you are really helpful for my research. keep on posting your views.
ReplyDeleteccna course in Chennai
ccna Training in Chennai
ccna Training institute in Chennai
ccna institute in Chennai
Best CCNA Training Institute in Chennai
Nice article. I liked very much. All the informations given by you are really helpful for my research. keep on posting your views.
ReplyDeleteccna training in bangalore
ccna training in coimbatore
ccna training institute in coimbatore
ccna course in Madurai
ccna training in madurai
Great Article
ReplyDeletebig data projects for cse final year students
Java Training in Chennai
Final Year Projects for CSE
Java Training in Chennai
Web development is constantly growing, your tutorials are great to learn these technology stacks and stay updated. Find resources for algorithms, data structures, and system design interview preparation. Amazing blog.
ReplyDelete