import Controller from "@ember/controller" ; import { action } from "@ember/object" ; import { Registry as ServiceRegistry , inject as service } from "@ember/service" ; export default class IndexController extends Controller { @ service ( "router" ) private _router ! : ServiceRegistry [ "router" ] ; @ action setSource ( source ) { this . versions . setSource ( source ) ; } @ action setTarget ( target ) { this . versions . setTarget ( target ) ; } @ action showDiff ( event ) { event . preventDefault ( ) ; this . _router . transitionTo ( `/${ this . versions . source }/${ this . versions . target }` ) ; } @ service ( "versions" ) versions ! : ServiceRegistry [ "versions" ] ; }