Closed terrywarwar closed 8 years ago
That's "as designed". If you wrap your code with asnyc(...)
to give Polymer time to stamp the template, it will work.
Tried async(()=>($['md'] as PaperDrawerPanel).togglePanel());
and still getting a null object.
Also when isLogin
is false?
It's set on ready() set("isLogin", false);
I am pretty sure this is working as intended. The $
map is only going to contain things that exist on initial render. You could try setting isLogin
to false in its initializer but I am not sure if that would work either. You should be able to use $$('#md')
instead which does an actual query for the element.
See https://www.polymer-project.org/1.0/docs/devguide/local-dom.html#node-finding
$['id1'] returns null when inside dom-if template. Works fine when it's outside the dom-if.