{"size": 865, "ext": "js", "max_stars_repo_path": "addon/mixins/control.js", "max_stars_repo_name": "ika-front-end/ember-forms", "max_stars_repo_stars_event_min_datetime": "2015-08-18T08:42:12.000Z", "max_stars_repo_stars_event_max_datetime": "2021-06-18T13:21:57.000Z", "max_issues_repo_path": "addon/mixins/control.js", "max_issues_repo_name": "ika-front-end/ember-forms", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "addon/mixins/control.js", "max_forks_repo_name": "ika-front-end/ember-forms", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 2, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 33.2692307692, "max_line_length": 83, "alphanum_fraction": 0.6994219653}
import Em from 'ember';

export default Em.Mixin.create({
  classNameBindings: ['isInput:form-control'],
  hasValue: Em.computed('value', function() {
    return this.get('value');
  }),
  isInput: true,
  attributeBindings: ['placeholder', 'required', 'autofocus', 'disabled', 'name'],
  placeholder: Em.computed.alias('parentView.placeholder'),
  required: Em.computed.alias('parentView.required'),
  autofocus: Em.computed.alias('parentView.autofocus'),
  disabled: Em.computed.alias('parentView.disabled'),
  type: Em.computed.alias('parentView.type'),
  model: Em.computed.alias('parentView.model'),
  propertyName: Em.computed.alias('parentView.propertyName'),
  'name': Em.computed.alias('propertyName'),

  isControl: true,

  init: function() {
    this._super();
    Em.Binding.from("model." + this.get('propertyName')).to('value').connect(this);
  }
});
