我正试图在一个离子应用程序中使用Asp.net api显示数据..从服务器获取值,但这里没有显示我的controller
exampleApp.controller("ExampleController", function($scope, $http) {
$scope.getData = function() {
$http.get('api/product', { params: { "username": "value1", "password": "value2" } })
.success(function(data) {
$scope.username = data.username;
$scope.password = data.password;
})
.error(function(data)
alert("ERROR");
});
}
这是我的HTML
<!DOCTYPE html>
<html>
<body ng-app="starter">
<ion-pane>
<ion-header-bar class="bar-stable">
<h1 class="title">Ionic Blank Starter</h1>
</ion-header-bar>
<ion-content ng-controller="ExampleController">
<br><br><br><br>
<button class="button" ng-click="getData()">click</button>
<br> username:{{username}} {{password}}
</ion-content>
</ion-pane>
任何人都可以告诉我哪里错了,或者我错过了什么......? 提前谢谢