mercredi 18 octobre 2023

how to get the previous routename in ember 2.16 to used in back button

i have a analytic route in ember this can be accessed from two routes (example user page and profile page) the below code is used to redirect to the analytic route

The problem is that i have a back button in the analytic page i want to send the user to the page from where the call is originated (i.e) if the user got to the analytic page from user page the back button should go to user page and if the user got to analytic page from profile page the back button should lead to profile page.

i dont want to mess the current code so i will be glad if the solution is in the form of action which returns the string of previous page. so that i could just call the action in place where i could give the dest page name.




samedi 14 octobre 2023

Ember-cli not using global version

This might actually more npm/node than just an EmberJS question.

Simply speaking I ran npm install -g ember-cli. However, when I check the version using ember --version, it shows me

ember-cli: 3.10.1
node: 18.18.2
os: darwin x64

That is definitely not the version I installed, because if i do npm ls -g --depth=0 to check my global packages, I get:

├── corepack@0.19.0
├── ember-cli@5.3.0
└── npm@10.2.0

To sanity check, i ran npm uninstall -g ember-cli and running npm ls -g --depth=0 again got

├── corepack@0.19.0
└── npm@10.2.0

So now, confirming that the global package is removed, I ran ember --version expecting the system to say ember is not installed, but instead i still get:

ember-cli: 3.10.1
node: 18.18.2
os: darwin x64

This leads me to believe there is some other installation of Ember on this computer and it's being used instead of the global version and I'd really like to just remove it - how do I find and remove it?

Useful context may be: I use NVM and Brew, although even in the past I didn't attempt to install ember with anything but the official installation direction of npm install -g ember-cli.