We have recently shifted from ember 2+ to Ember 3.18.0 and i am struggling to call the controller function from a component. In previous version we were using sendAction to bubble the action but now as sendAction is depreciated and closures are being used i am not able to make it correctly.
Below is my code
Controller.hbs
{{generic-err-modal err=receivedErr showDialog= this.showErrorModal onSave=(action "closePromptDialog")}}
Controller.js
@action
closePromptDialog(){
this.set("showErrorModal",false);
}
Component.hbs
{{#if @showDialog}}
<PaperDialog id="genericModal" class="flex-50" @fullscreen={{fullscreen}} @onClose={{action "closePromptDialog"}} @origin={{dialogOrigin}}>
<PaperDialogContent class="text-align-center">
{{paper-icon "remove_circle_outline" class="red" size=48}}
</PaperDialogContent>
<PaperDialogContent>
<h2>{{@err.errorMessage}}</h2>
</PaperDialogContent>
<PaperDialogActions @class="layout-row">
<span class="flex"></span>
<PaperButton @primary={{true}} @onClick={{action "hideModal"}} @raised={{true}}>Ok</PaperButton>
</PaperDialogActions>
</PaperDialog>
{{/if}}
Component.js
@action
hideModal(){
this.args.onSave();
}
on this i am getting error as
Uncaught TypeError: method is not a function
Any help will be very much appreciated.
Ember version i am using is 3.18.0