没有“访问-控制-允许-原产地”-节点/Apache端口问题
// Api Using Node/Express var express = require('express');var app = express();var contractors = [ { "id": "1", "name": "Joe Blogg", "Weeks": 3, "Photo": "1.png" }];app.use(express.bodyParser());app.get('/', function(req, res) { res.json(contractors);});app.listen(process.env.PORT || 3000);console.log('Server is running on Port 3000') // Angular code angular.module('contractorsApp', []) .controller('ContractorsCtrl', function($scope, $http,$routeParams) { $http.get('localhost:3000').success(function(data) { $scope.contractors = data; }) // HTML <body ng-app="contractorsApp"> <div ng-controller="ContractorsCtrl"> <ul> <li ng-repeat="person in contractors">{{person.name}}</li> </ul> </div> </body>
慕盖茨4494581
湖上湖
哆啦的时光机