0

I got a deprecation message when running my app: DEPRECATION: Using the Ember.Location.registerImplementation is no longer supported. Register your custom location implementation with the container instead.. The code is in the app.js.

It is for the hashbang functionality, and I saw someone already written a nice implementation for that: https://stackoverflow.com/a/23055007/1153884

So I literally copied and pasted that code. But after fiddling I could not get it to work. It is because App.register trows an error: Uncaught TypeError: undefined is not a function enter image description here

I have also tested with App.__container__.register. However that does also not work. Is there something changed with the latest Ember CLI that I am not aware of?

1 Answer 1

2

Ember CLI doesn’t use App as a global namespace, it uses ES6 modules.

You can create a new initializer in app/initialzers:

export default {
  name: 'hashbang',
  initialize: function(container, application) {
    // your code here
  }
}

The initializer is passed the container as a parameter.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.