javascript - How to change current template/route by an external script? -
javascript - How to change current template/route by an external script? -
in ember.js-app, ive got 1 template includes javascript-jquery-script. within script want phone call ember read out variables, safe them, , alter template
like so
finishedgame = function() { // ember create model-entry using "this.points" // ember alter template "game/credits" }; how can utilize ember hook independent-running script , start functionality switching templates etc. or ist possible access controller functions elsewhere ember-scripts itselv?
one bad approach utilize global variable , observe within ember described in this answer, can trigger whatever action require, not recommended.
as this other answer states, if find thinking global variable best solution it's sign should refactored.
so in case go calling finishedgame() function within ember scope, controller (probably ember.$ if jquery) , have function homecoming values want save, issue phone call transitiontoroute method (take @ documentation).
javascript jquery ember.js
Comments
Post a Comment