Looks like your firebase element is not in the template, and therefore
won't be in this.$
On Jul 22, 2015 9:45 PM, "Himali Kiran" <[email protected]> wrote:
> Thank you so much,
> But if I remove curly braces it gives another error:
>
> Uncaught TypeError: Cannot read property 'login' of undefined
>
> I made following changes:
>
>> <firebase-auth id="baseLogin" user="{{user}}"
>>> statusKnown="{{statusKnown}}"
>>
>> location="https://himalikiran.firebaseio.com" provider="github"
>>> on-login="onLogin"
>>
>> on-error="onLoginError"></firebase-auth>
>>
>>
>>> <template>
>>
>> <paper-menu-button>
>>
>> <paper-icon-button icon="social:person"
>>> class="dropdown-trigger"></paper-icon-button>
>>
>> <paper-menu class="dropdown-content">
>>
>> <paper-item on-tap="login" hidden?="{{!statusKnown ||
>>> user}}">Login</paper-item>
>>
>> <paper-item on-tap="logout" hidden?="{{!statusKnown ||
>>> !user}}">Logout</paper-item>
>>
>> </paper-menu>
>>
>> </paper-menu-button>
>>
>> </template>
>>
>>
>
> On Thursday, 23 July 2015 09:35:30 UTC+5:45, Daniel Freedman wrote:
>>
>> Polymer 1.0 event handlers don't use the curly brace syntax. Just
>> on-login="onLogin" and all the others as well.
>> On Jul 22, 2015 8:47 PM, "Himali Kiran" <[email protected]> wrote:
>>
>>> I am getting following error.
>>> [firebase-login::_createEventHandler]: listener method `{{login}}` not
>>> defined
>>>
>>> Actual Code:
>>>
>>> <dom-module id="firebase-login">
>>> <style>
>>> :host {
>>> display: block;
>>> }
>>> </style>
>>> <firebase-auth id="baseLogin" user="{{user}}"
>>> statusKnown="{{statusKnown}}"
>>> location="https://himalikiran.firebaseio.com" provider="github"
>>> on-login="{{onLogin}}"
>>> on-error="{{onLoginError}}"></firebase-auth>
>>>
>>> <template>
>>> <paper-menu-button>
>>> <paper-icon-button icon="social:person"
>>> class="dropdown-trigger"></paper-icon-button>
>>> <paper-menu class="dropdown-content">
>>> <paper-item on-tap="{{login}}" hidden?="{{!statusKnown
>>> || user}}">Login</paper-item>
>>> <paper-item on-tap="{{logout}}"
>>> hidden?="{{!statusKnown || !user}}">Logout</paper-item>
>>> </paper-menu>
>>> </paper-menu-button>
>>> </template>
>>> <template if="{{user}}">{{user.github.username}}</template>
>>> </dom-module>
>>>
>>> <script>
>>> (function() {
>>> Polymer({
>>> is: 'firebase-login',
>>>
>>> properties: {
>>>
>>> },
>>>
>>> login : function(){
>>> console.log('working');
>>> this.$.baseLogin.login();
>>> },
>>> logout : function() {
>>> this.$.baseLogin.logout();
>>> }
>>> });
>>> })();
>>> </script>
>>>
>>> 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/7c418074-23f8-4405-bef5-88ac9a23dd44%40googlegroups.com
>>> <https://groups.google.com/d/msgid/polymer-dev/7c418074-23f8-4405-bef5-88ac9a23dd44%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/CAAUAVAjKc%3DPjq45PkwRZLoHPVm6UhDK5%2B5_FxV5jHcHSUO53LQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.