4

I have code like this in my view model:

function ChatListViewModel(chats) {
    var self = this;

    self.newCommentText = ko.observable();

    self.addComment = function(chat) {
      var newComment = { CourseItemDescription: this.newCommentText() };
      chat.CommentList.push(newComment);
      self.newCommentText("");       
    };

}

ko.applyBindings(new ChatListViewModel(initialData));

but I get this error when I try to add a new comment:

enter image description here

any Ideas what I'm doing wrong? I looked at some knockout samples on the knockoutjs.com webpage and this is how they were doing it.


TFS Branching recommendation

I have a Solution called "Framework" which is a C# assembly for my business logic and data transactions.

I have 4 applications that use Framework, 1 website, 1 Console app and 3 other types of applications.

$/TeamProject
    /Framework
        /Dev
        /Main
        /Release
    /WebApp
        /Dev
        /Main
        /Release
    /WCFApp
        /Dev
        /Main
        /Release

I have all these in one Team Project with each assembly/application under its own folder.

I want to use the branching feature for each of the applications that share the Framework assembly but I don't know what is the best way to branch the Application along with the Framework?

Any suggestions?

I know how Branching and merging works, but all the examples only demonstrate branching everything that is contained in 1 folder.

4

1 に答える 1

5

これを試して。

self.addComment = function(chat) {
   var newComment = { CourseItemDescription: self.newCommentText() };
   chat.CommentList.push(newComment);
   self.newCommentText("");       
};

あなたの this 変数はあなたが期待するものではありません。

お役に立てれば。

于 2012-06-13T20:50:07.317 に答える