Forked from jbandura/application.controller.js
Last active
December 19, 2018 07:57
-
-
Save michalsnik/f553dfdb3ad17c7bbc32d78f1a7a4d60 to your computer and use it in GitHub Desktop.
ember-rekru
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Controller from '@ember/controller'; | |
export default Controller.extend({ | |
user: { | |
fullName: 'Emma Watson', | |
}, | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Route from '@ember/routing/route'; | |
export default Route.extend({ | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Component from '@ember/component'; | |
import { observer, get, set } from '@ember/object'; | |
export default Component.extend({ | |
members: [], | |
currentMember: null, | |
membersAmount: 0, | |
onAddedMembers: observer('members.[]', function() { | |
set(this, 'membersAmount', get(this, 'members.length')); | |
}), | |
actions: { | |
addMember(member) { | |
get(this, 'members').pushObject(get(this, 'currentMember')); | |
set(this, 'currentMember', null); | |
}, | |
deleteMember(member) { | |
get(this, 'members').removeObject(member); | |
} | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Component from '@ember/component'; | |
import { alias } from '@ember/object/computed'; | |
export default Component.extend({ | |
userName: alias('user.fullName'), | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"version": "0.15.1", | |
"EmberENV": { | |
"FEATURES": {} | |
}, | |
"options": { | |
"use_pods": false, | |
"enable-testing": false | |
}, | |
"dependencies": { | |
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.js", | |
"ember": "3.4.3", | |
"ember-template-compiler": "3.4.3", | |
"ember-testing": "3.4.3" | |
}, | |
"addons": { | |
"ember-data": "3.4.2" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment