You task definition doesn’t contain a status property:
var task = {
name: ko.observable(),
Description: ko.observable(),
date: ko.observable(d + "/" + m + "/" + y),
priority: ko.observable(1),
};
I’m not my computer to test, but try:
var task = {
name: ko.observable(),
Description: ko.observable(),
date: ko.observable(d + "/" + m + "/" + y),
priority: ko.observable(1),
status: ko.observable();
};
Sent from Mail for Windows 10
--
You received this message because you are subscribed to the Google Groups "KnockoutJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to knockoutjs+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/knockoutjs/8daf65f3-43b8-499a-8004-4304fe7cfb58n%40googlegroups.com.
Please disregard my previous statement. After looking it over, it seems like in AddTask you’re creating a payload with an observable status, then following it up with a call to unwrap the observable and push it into the tasks array.
if (task.name() && task.Description()) {
var paylaod = { name: task.name(), Description: task.Description(), date: task.date(), priority: task.priority(), status: ko.observable("new") };
tasks.push(ko.toJS(paylaod));
If you want your status to remain an observable, don’t call ko.toJS().
From: Dhirendra Tripathi
Sent: Tuesday, December 8, 2020 1:13 PM
To: KnockoutJS
--