Can i call javascript code to close window from Ember button or link

Sorry javascript/ember noob question, I have an Ember page with a link and a button. Is it possible when i click on either of them to call javascript code to close the browser tab in which the ember page is opened.

You can only close a window if it was opened by a script (see window.close)

Triggering code from a template involves adding an action to an element