Hi,

I have problems with the two-way-databinding.

I have a factory "project" to handle my data model.

In a controller I use

$scope.all_entries = $scope.project.getEntries();

to bind and show all entries with a two-way-databinding. Works fine.

In the same controller I want to get the date without time from the first 
entry for further calculations.

var first_day = new Date(); //default: today
if($scope.all_entries.length>0){
 first_day = new Date($scope.all_entries[0].date_time);//get date with time 
from first entry
}
first_day.setHours(0,0,0,0); //remove time


Because of the two-way-databinding the time information get also lost in 
$scope.all_entries.

How can I use a one-way-databinding in the code line:

first_day = new Date($scope.all_entries[0].date_time);//get date with time 
from first entry


so that "$scope.all_entries[0].date_time" is not connected to first_day?

Thanks and best regards
Benedikt

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to