• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 129
  • Last Modified:

angular http request

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
Seven price
Asked:
Seven price
1 Solution
 
leakim971PluritechnicianCommented:
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
 
Seven priceFull StackAuthor Commented:
thanks  i would not think I had to add another var to module.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now