Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function ChildCollectionViewModel() {
- var self = this;
- self.CollectionElements = ko.observableArray([]);
- // data-bound to a button that adds a new element
- self.addCollectionElement = function () {
- self.CollectionElements.push(new CollectionElement());
- };
- // data-bound to a button that removes the current element
- self.removeCollectionElement = function (collectionElement) {
- self.CollectionElements.destroy(collectionElement);
- };
- function CollectionElement() {
- var self = this;
- self.Id = ko.observable();
- self.Prop1 = ko.observable();
- self.Prop2 = ko.observable();
- self.Prop3 = ko.observable();
- }}
Add Comment
Please, Sign In to add comment