Last active
April 29, 2016 15:46
-
-
Save nruth/93416519a4537be6fb845d88a4ea7a22 to your computer and use it in GitHub Desktop.
ember.js acceptance test window.location redirector abstraction service
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Service.extend({ | |
redirectTo(href) { | |
window.location.href = href; | |
}, | |
replace(href) { | |
window.location.replace(href); | |
}, | |
reload() { | |
window.location.reload(); | |
} | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
redirector: Ember.inject.service(), | |
actions: { | |
foo() { | |
this.get('redirector').replace('https://www.google.com'); | |
} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment