Skip to content
Permalink
Browse files

Add an action to the attribute to make DDAU compatible

  • Loading branch information...
corrspt committed Nov 19, 2016
1 parent aa38977 commit 63e9d0773a17206f9781ba11f60fa766132070d9
Showing with 21 additions and 1 deletion.
  1. +18 −1 app/controllers/application.js
  2. +2 −0 app/templates/application.hbs
  3. +1 −0 app/templates/components/attribute-text.hbs
@@ -1,4 +1,21 @@
import Ember from 'ember';

export default Ember.Controller.extend({
const {
Controller,
get
} = Ember;

export default Controller.extend({

actions: {
setName(name) {
let model = get(this, 'model');
model.set('name', name);
},

setAge(age) {
let model = get(this, 'model');
model.set('age', age);
}
}
});
@@ -9,6 +9,7 @@
attribute='name'
label='Name'
placeholder='Insert your name'
onUpdateValue=(action 'setName')
}}
</div>
<div class="col-sm-6">
@@ -18,6 +19,7 @@
attribute='age'
label='Age'
placeholder='Insert your age'
onUpdateValue=(action 'setAge')
}}
</div>
</div>
@@ -4,6 +4,7 @@
</label>
<input
value={{get model attribute}}
oninput={{action this.attrs.onUpdateValue value="target.value"}}
class='form-control'
placeholder={{placeholder}}
type='text'

0 comments on commit 63e9d07

Please sign in to comment.
You can’t perform that action at this time.