Hi, Yeah, I think the issue you're seeing is because observers can fire before `ready` is called.
You could probably update things to use data bindings instead of, say, adding or removing classes manually. But under the circumstances, probably the simplest thing is to check whether `this.$` exists going into the observer method and exit quickly if it doesn't. The call the observer method manually at the end of the `ready` callback. Cheers, Arthur On Sun, Sep 24, 2017 at 7:54 AM, thomasmulhall410 via Polymer < [email protected]> wrote: > Hi, i am wondering how do i use legacy elements in polymer 2.x please? > > I am trying to access this.$ but it's returning undefined so i carn't do > for example this.$.router.start(). > > I am trying to update polymer to 2.x here https://gerrit-review. > googlesource.com/?polygerrit=0#/c/gerrit/+/128730/ for the gerrit project. > > this.$.router.start() is returning undefined in gr-app.js. > > Follow Polymer on Google+: plus.google.com/107187849809354688692 > --- > You received this message because you are subscribed to the Google Groups > "Polymer" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit https://groups.google.com/d/ > msgid/polymer-dev/1caaa9d4-87d8-4fa9-9431-b2f0920e1f48%40googlegroups.com > <https://groups.google.com/d/msgid/polymer-dev/1caaa9d4-87d8-4fa9-9431-b2f0920e1f48%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > Follow Polymer on Google+: plus.google.com/107187849809354688692 --- You received this message because you are subscribed to the Google Groups "Polymer" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/polymer-dev/CADSbU_y1wGbCJ3Oca%2BzjCsD%2Bc%2BXEE3PmmmBrrgZuNmdupmJ%3D7w%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
