3

Inside my viewmodel I have following code:

var self = this;
self.Name = ko.observable(data.Name);
var mapped = $.map(data.Addresses, function (item) { return new Address(item) });
self.AddressList = ko.observableArray(mapped);
self.dirtyFlag = new ko.DirtyFlag([self.Name, self.AddressList]);

I always get the dirty flag true due to AddressList.

Is there a way to specify what value is not dirty or when to start monitoring for change?

J0e3gan
  • 8,740
  • 10
  • 53
  • 80

1 Answers1

1

Sounds like maybe something in your address is bound to a select with the value binding and it is writing a value on the initial binding. It will change numbers to strings. You could always choose to call reset on the flag after applying bindings (call self.dirtyFlag.reset()

RP Niemeyer
  • 114,592
  • 18
  • 291
  • 211