Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function conc(x, y_theoretical, y_measured) {
- var self = this;
- self.x = ko.observable(x);
- self.y_t = ko.observable(y_theoretical);
- self.y_m = ko.observable(y_measured);
- function ConcentrationViewModel() {
- var self = this;
- self.concentrations = ko.observableArray([
- new conc(2, 9, 8),
- new conc(6, 10, 11),
- new conc(8, 12, 13),
- new conc(10, 14, 15),
- new conc(14, 16, 17),
- new conc(19, 18, 19)
- ]);
- self.a = ko.computed(function() {
- var res = self.concentrations[0].x + self.concentrations[1].x;
- return res;
- },this);
- self.b = ko.computed(function() {
- return 15;
- },this);
- debugger;
- ko.applyBindings(new ConcentrationViewModel());
- debugger;
- var value = self.myObservableProperty();
- self.myObservableProperty(newValue);
- self.a = ko.computed(function(){
- var allConcentrations = self.concentrations();
- return allConcentrations[0].x() + allConcentrations[1].x();
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement