Skip to content

Instantly share code, notes, and snippets.

@Samsinite
Last active August 29, 2015 14:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Samsinite/8d2e14878b2fb70b716d to your computer and use it in GitHub Desktop.
Save Samsinite/8d2e14878b2fb70b716d to your computer and use it in GitHub Desktop.
bootstrap select compoent
<!-- app/templates/components/bootstrap-input.hbs -->
<label for="{{inputId}}">{{label}}</label>
{{input value=value placeholder=placeholder elementId=inputId classNames="form-control"}}
//app/components/bootstrap-input.js
import Ember from 'ember';
var _uid = 0;
function generateUID() {
return ++_uid;
}
export default Ember.Component.extend({
value: null,
classNames: ['form-group', 'bootstrap-input-component'],
inputId: Ember.computed(function() {
return `bootstrap-input-component-${generateUID()}`;
})
});
{{bootstrap-input value=model.name
placeholder="Enter a name..."
label="Name"}}
{{bootstrap-input value=model.description
placeholder="Enter a description..."
label="Description"}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment