using location in ember (how to lookup)

87 views Asked by At

Trying to use the Location class with Ember 3.4.

How to instantiate/lookup/inject the Location class in my routes?

Writing this in a route file doesn't work:

import Location from '@ember/routing/location';

[...]

//in some action method
console.log(Location.getURL());

[...]

The result is:

getURL is not a function

This worked:

this.router.location.getURL();
0

There are 0 answers