Could someone explain me why this works
self.test("some data");
<span data-bind="text:test"></span>
and this not work
self.test(ko.mapping.fromJS({ complex: "object"}));
<span data-bind="text:test.complex"></span>
test
is an observable, so you have to unwrap it to access the internal properties.
self.test(ko.mapping.fromJS({ complex: "object"}));
<span data-bind="text:test().complex"></span>