I have this code:
<template repeat="{{user in today}}">
<template if="{{user.yesterday == null}}">
<template if="{{user.id == userid}}">
<div id="me">
<div class="username"><a href="mailto:{{user.email}}" class="nodecor">{{user.name}}</a></div>
<span class="absent">Didn't show up!</span><br />
<br />
</div>
</template>
<template if="{{user.id != userid}}">
<div class="username"><a href="mailto:{{user.email}}" class="nodecor">{{user.name}}</a></div>
<span class="absent">Didn't show up!</span><br />
<br />
</template>
</template>
</template>
The template-if's are all working. But, when I try to access id 'me', it tells me it is either undefined or null. Using:
this.$.me
only works if it's not inside a template-if. I am accessing it from 'ready', like this:
Polymer(
'meeting-card',
{
ready:
function() {
enter = this.$.enter;
dontenter = this.$.dontenter;
me = this.$.me;
checkHours();
checkInterval = setInterval(
function() {
checkHours();
},
15000
);
}
}
Both enter and dontenter work, but me does not. The only difference is that enter and dontenter div's are not inside template-if tags.
Should I use a class name to access that div, instead? If not, what is the right way to access that div, by Id?
Thanks.