[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

angular http request

Posted on 2014-12-11
2
Medium Priority
?
127 Views
Last Modified: 2014-12-11
question, Im new angularjs and my http api request worked with angular 2.1 but with the latest it does not work. nor can I use my module.

http://jsfiddle.net/sevensnake/f89jbcry/3/

and help why it stopped working would be great.
0
Comment
Question by:Seven price
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 82

Accepted Solution

by:
leakim971 earned 2000 total points
ID: 40494815
Updated : http://jsfiddle.net/f89jbcry/4/

var myAppModule = angular.module('myApp',[]);
var MainCtrl = function($scope, $http) {

  var onUserComplete = function(response) {
    $scope.user = response.data;
  };
  $http.get("https://api.github.com/users/Sevensnake")
    .then(onUserComplete);

  $scope.message = "hello,sev"; 
};

var myCtrl = myAppModule.controller("MainCtrl", MainCtrl);

var mytest = function($scope) {
    $scope.newline = "whats up";
};

Open in new window

0
 
LVL 9

Author Closing Comment

by:Seven price
ID: 40494905
thanks  i would not think I had to add another var to module.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question