Is it possible to set default property to components in ember.js?

ember.js, handlebars.js

Solution

Yep, you can subclass `Ember.Component`:

YourApp.GdTextInputComponent = Ember.Component.extend({
    type: 'text'
});

Problem

I have a simple component that looks like this: ``` <script type="text/x-handlebars" id="components/Gd-text-input"> <label {{bind-attr for="name"}}> {{label}} </label> <input type="text" {{bind-attr name="key" id="name"}} /> </script> ``` I would like to add the attribute type to the input field, and if no type is passed when including the component, like this for example: ``` {{Gd-text-input label="First Name" name="firstname" key="entry.810220554" }} ``` I would like it to default to type="text". How would I go about doing this?

Original source