I'm wondering why my DatBinding is not working.
The problem is in the function foo
where the $scope.data.time
is set properly but my input-value
does not change. Why?
Here is the Code of my Controller:
.controller('MyCtrl', function($scope, $ionicPopup, $cordovaDatePicker) {
$scope.foo = function() {
$cordovaDatePicker.show().then(function(date){
// PROBLEM: the $scope.data is set right, but my input value does not change
$scope.data.time = date;
});
};
$scope.showPopup = function() {
$scope.data = {};
$scope.data.time = new Date();
var myPopup = $ionicPopup.show({
template: '<input type="text" ng-click="foo()" value="{{data.time.toDateString()}}">'
title: 'Enter new record',
scope: $scope,
...
});
};
});
Set $ionicPopup scope to $scope after template.
Eg.
template : 'your template input', scope : $scope
I found the answer by myself: the framework which I'm using is caching the site. So I needed to disable caching and now it work perfect.