Last active
October 8, 2015 15:28
-
-
Save stavarotti/c5d61649dc617ee967a9 to your computer and use it in GitHub Desktop.
generate a dynamic url in Ember
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
_generateUrl(routeName, dynamicSegments, queryParams) { | |
const router = this.get('router'); | |
const args = [ routeName ].concat(dynamicSegments); | |
if (queryParams) { | |
args.push({ queryParams }); | |
} | |
const url = router.generate(...args); | |
if (url[0] === '#') { | |
return url.substring(1); | |
} | |
return url; | |
} | |
//return this.get('container').lookup('router:main’);` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment