This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
To reproduce, please try to create KnockoutJS sample project (KnockoutJS must-play game list) and open the html page => Navigator does not contain gamesToPlay, gamesCount etc. and also code completion in <strong data-bind="text: |"></strong> does not offer these properties. It is because they are declared using self pattern self = this; self.gamesToPlay = ko.observableArray(games); Product Version: NetBeans IDE Dev (Build web-main-10560-on-20130519) Java: 1.7.0_21; Java HotSpot(TM) Client VM 23.21-b01 Runtime: Java(TM) SE Runtime Environment 1.7.0_21-b11 System: Linux version 3.2.0-43-generic-pae running on i386; UTF-8; en_US (nb)
Petr Pisl already implemented #229717 - The common constructor pattern with "self" is not supported. So possibly sg. needs to be also done at the KO side or there's a bug in the ppisl's change.
Yep pretty strange. I guess some more tweaking has to be done for self pattern in the model. I'll try to (at least) evaluate it.
It looks like the self variable in your sample is global and that's why the self-pattern detection does not work imo. Is the use of global variable intentional?
I think that is just unfortunate choice of sample's author
Petre, can you tweak the self pattern solution?
Issue is not reproducible using current dev build (and using KO sample project): Product Version: NetBeans IDE Dev (Build 20150302-84205dde7ed0) Java: 1.7.0_75; Java HotSpot(TM) 64-Bit Server VM 24.75-b04 Runtime: Java(TM) SE Runtime Environment 1.7.0_75-b13 System: Mac OS X version 10.10.2 running on x86_64; UTF-8; en_US (nb)
This is still reproducible (albeit it is a bad pattern), you need to make self on line 10 global again: self = this The sample project author fixed it after I asked him to do so [1] so it would work in NetBeans :) [1] https://github.com/bernardobrezende/KnockoutJS.Tips/issues/1
(In reply to Vladimir Riha from comment #7) > This is still reproducible (albeit it is a bad pattern), you need to make > self on line 10 global again: > > self = this Thanks for the clarification,. This can be reproduced in Plain JS as well: MyModel = function() { self = this; self.demoProperty = 'demo'; }; var m = new MyModel(); m.| demoProperty is not offered by CC. I am lowering to P4, since it is really bad practice.