1.観測可能な配列に項目を追加し、2.配列に既に存在する場合は項目を置き換える関数を作成しようとしています
self.addNotification = function (name, availability, note) {
//see if we already have a line for this product
var matchingItem = self.notifications.indexOf(name);
if (matchingItem !== undefined) {
self.notifications.replace(self.notifications()[index(matchingItem)],
new Notification(self, name, availability, note));
}
else {
self.notifications.push(new Notification(self, name, availability, note));
}
};
私は何を間違っていますか?
よろしくアンダース