The problem is when type new value with input in ionicModal, the $scope value is not refresh
the code
controller
$scope.username = null;
$scope.password = null;
$scope.login = function(u,p){
var data = {
username:u,
password:p
}
$http.post('http://localhost:1337/login',data)
.success(function(data, status, headers,config){
console.log(data);
$scope.modal.hide();
})
.error(function(data, status, headers,config){
var alertPopup = $ionicPopup.alert({
title: '登陆错误!',
template: data.error,
buttons:[
{
"text":"确认",
"type":"button-assertive"
}
]
});
});
}
$scope.username and $scope.password is bind to input, but they are not refresh when type new value,
For example, input value is ‘aaaa’, but $scope.username was still null, I guess the scope in ionicModal was the copy of parentScope, so scope value in ionicModal is refresh, but parentScope is not refresh