Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (function () {
- 'use strict';
- /**
- * @ngdoc function
- * @name app.controller:HomeCtrl
- * @description
- * # HomeCtrl
- * Controller of the app
- */
- angular.module('BlurAdmin.pages.dashboard')
- .controller('HomeCtrl', ['$scope', '$rootScope', '$stateParams', '$http', '$location', HomeCtrl ]);
- function HomeCtrl($scope, $http, $location) {
- $scope.samples = [['a', 'b', 'c'], ['d', 'e', 'f']];
- console.log($http);
- console.log($scope);
- console.log($location);
- console.log(window.location.hostname);
- $http.get(
- 'http://localhost' + ':7000/samples',
- {}
- ).then(function(err, data){
- if (err){
- console.log(err);
- }
- console.log(data);
- },
- function(err, data){
- });
- var varApplist = this;
- }
- })();
- <div id="page-wrapper" ng-controller="HomeCtrl">
- ......
- <div>
- TypeError: $http.get is not a function
- at new HomeCtrl (http://localhost:4001/app/pages/dashboard/home/homeCtrl.js:21:11)
- at invoke (http://localhost:4001/bower_components/angular/angular.js:4570:17)
- at Object.instantiate (http://localhost:4001/bower_components/angular/angular.js:4578:27)
- at http://localhost:4001/bower_components/angular/angular.js:9460:28
- at http://localhost:4001/bower_components/angular-ui-router/release/angular-ui-router.js:4081:28
- at invokeLinkFn (http://localhost:4001/bower_components/angular/angular.js:9099:9)
- at nodeLinkFn (http://localhost:4001/bower_components/angular/angular.js:8586:11)
- at compositeLinkFn (http://localhost:4001/bower_components/angular/angular.js:7975:13)
- at publicLinkFn (http://localhost:4001/bower_components/angular/angular.js:7855:30)
- 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