Hi,

I have a quite simple component that presents a login screen with native 
input elements. There is a button which calls "logIn()" on click. If I 
print out the values of username/password, both are undefined. I tried 
everything, but nothing works. 

<dom-module id="dashboard-login">
    <template>
        <style>
            :host {
                display: block;
            }
        </style>
        <h2>Hello [[prop1]], authenticated=[[authenticated]]!</h2>
        <div>
            <div><label>Username: </label><input 
value="{{username::input}}"></input></div>
            <div><label>Password: </label><input type="password" 
value="{{password::input}}"></input></div>
            <div>
                <button onclick="{{logIn}}" raised>Log in</button>
            </div>
        </div>
    </template>

    <script>
        /**
         * `dashboard-login`
         * Login to Dashboard
         *
         * @customElement
         * @polymer
         * @demo demo/index.html
         */
        class DashboardLogin extends Polymer.Element {
            constructor() {
                super();
            }

            static get is() {
                return 'dashboard-login';
            }

            static get properties() {
                return {
                    prop1: {
                        type: String,
                        value: 'dashboard-login'
                    },
                    username: {
                        type: String,
                        value: 'username'
                    },
                    password: {
                        type: String,
                        value: 'password'
                    },
                    authenticated: {
                        type: Boolean,
                        value: false
                    }

                };
            }


            logIn() {
                console.log("username="+this.username+", 
password="+this.password);
            }

        }

        window.customElements.define(DashboardLogin.is, DashboardLogin);
    </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 polymer-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/polymer-dev/e106505f-ddb5-40aa-bcd9-dc8df36bf4f0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to