export default Ember.Component.extend({
actions: {
open(obj){
console.log('OPEN');
},
});
export default Ember.Component.extend({ // дочерние компоненты
alarm(){
this.send('open', this);
},
});
test(obj){
console.log(obj);
}
{{child-component test=(action "test") }}
open(){
console.log('child fired');
this.sendAction('test', this);
}
<a href="#" {{action 'open'}}>Тест</a>
export default Ember.Component.extend({
actions: {
open(obj){
console.log('OPEN');
},
},
});
export default Ember.Component.extend({ // дочерние компоненты
alarm(){
this.sendAction('alarm', this);
},
});
{{yield this}}
{{#parent-component as |parent|}}
{{child-component alarm=(action "open" target=parent)}}
{{/parent-component}}
export default Ember.Service.extend({
stack_view:[],
open(obj){
},
});
export default Ember.Component.extend({
manager: Ember.inject.service(),
init:function(){
this.get('manager').set('open', this.open);
},
actions: {
open(obj){
console.log('OPEN');
},
});
export default Ember.Component.extend({ // дочерние компоненты
manager: Ember.inject.service(),
actions: {
open(){
this.get('manager').open(this);
},
}
});