View Full Version : 4.2.2 Controller refs

31 Oct 2013, 4:16 AM
Hello, I found out, that inside a controller if I define a ref with a selector like
refs: [{ref: 'mycomponent', selector: 'mycomponent{isVisible(true)}'}] the automatic generated getter delivers the same result, no matter if I am working with multiple instances of myComponent and only one is visible at a time. It would be very usefull if the componentquery which is build by the refs selector would be build every time I use the getter of my ref. Otherwise I can not use my refs with multiple instances. Can somebody explain me why this happens?

3 Nov 2013, 3:31 AM
Ref caches query results. If you don't need this, you can always create your own method that will execute fixed query and return first result (possibly null).