Skip to content

Instantly share code, notes, and snippets.

@Samsinite
Last active August 29, 2015 14:21
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
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