需要注册$http服务
myapp.controller(‘index’, [ ‘
s
c
o
p
e
′
,
′
scope', '
scope′,′http’, '
l
o
c
a
t
i
o
n
′
,
′
m
y
S
e
r
v
i
c
e
1
′
,
f
u
n
c
t
i
o
n
(
location', 'myService1', function(
location′,′myService1′,function(scope, $http, $location, myService1) {
$scope.userinfo = “”;
$http({
method : “get”,
url : “http://localhost:8080/ssm/userinfo.do”
}).then(function(data) {
console.log(data.data);
$scope.userinfo = data.data;
})
} ])