Advertisement
Guest User

Untitled

a guest
Mar 24th, 2017
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.93 KB | None | 0 0
  1. (function () {
  2. 'use strict';
  3.  
  4. /**
  5. * @ngdoc function
  6. * @name app.controller:HomeCtrl
  7. * @description
  8. * # HomeCtrl
  9. * Controller of the app
  10. */
  11.  
  12. angular.module('BlurAdmin.pages.dashboard')
  13. .controller('HomeCtrl', ['$scope', '$rootScope', '$stateParams', '$http', '$location', HomeCtrl ]);
  14. function HomeCtrl($scope, $http, $location) {
  15. $scope.samples = [['a', 'b', 'c'], ['d', 'e', 'f']];
  16.  
  17. console.log($http);
  18. console.log($scope);
  19. console.log($location);
  20. console.log(window.location.hostname);
  21. $http.get(
  22. 'http://localhost' + ':7000/samples',
  23.  
  24. {}
  25. ).then(function(err, data){
  26. if (err){
  27. console.log(err);
  28. }
  29. console.log(data);
  30. },
  31. function(err, data){
  32. });
  33.  
  34. var varApplist = this;
  35. }
  36. })();
  37.  
  38. <div id="page-wrapper" ng-controller="HomeCtrl">
  39. ......
  40. <div>
  41.  
  42. TypeError: $http.get is not a function
  43. at new HomeCtrl (http://localhost:4001/app/pages/dashboard/home/homeCtrl.js:21:11)
  44. at invoke (http://localhost:4001/bower_components/angular/angular.js:4570:17)
  45. at Object.instantiate (http://localhost:4001/bower_components/angular/angular.js:4578:27)
  46. at http://localhost:4001/bower_components/angular/angular.js:9460:28
  47. at http://localhost:4001/bower_components/angular-ui-router/release/angular-ui-router.js:4081:28
  48. at invokeLinkFn (http://localhost:4001/bower_components/angular/angular.js:9099:9)
  49. at nodeLinkFn (http://localhost:4001/bower_components/angular/angular.js:8586:11)
  50. at compositeLinkFn (http://localhost:4001/bower_components/angular/angular.js:7975:13)
  51. at publicLinkFn (http://localhost:4001/bower_components/angular/angular.js:7855:30)
  52. at updateView (http://localhost:4001/bower_components/angular-ui-router/release/angular-ui-router.js:4021:23) <div ui-view="" class="ng-scope">
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement