-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduce
ember-registry-container-reform
feature flag.
* Ensure that `Container#_registry` remains supported for now. Can be deleted once cont/reg reform is enabled by default. * Continue to expose `registry` and `container` on `ApplicationInstance`. These can be removed once cont/reg reform is enabled, but we’ll still need to expose `ApplicationInstance.container.lookup` until 3.0. * Flag deprecation of Application initializer `initialize` arguments.
- Loading branch information
Showing
8 changed files
with
164 additions
and
45 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
25 changes: 19 additions & 6 deletions
25
packages/ember-routing/lib/initializers/routing-service.js
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,27 @@ | ||
import { onLoad } from 'ember-runtime/system/lazy_load'; | ||
import RoutingService from 'ember-routing/services/routing'; | ||
import isEnabled from 'ember-metal/features'; | ||
|
||
let initialize; | ||
if (isEnabled('ember-registry-container-reform')) { | ||
initialize = function(application) { | ||
// Register the routing service... | ||
application.register('service:-routing', RoutingService); | ||
// Then inject the app router into it | ||
application.inject('service:-routing', 'router', 'router:main'); | ||
}; | ||
} else { | ||
initialize = function(registry, application) { | ||
// Register the routing service... | ||
registry.register('service:-routing', RoutingService); | ||
// Then inject the app router into it | ||
registry.injection('service:-routing', 'router', 'router:main'); | ||
}; | ||
} | ||
|
||
onLoad('Ember.Application', function(Application) { | ||
Application.initializer({ | ||
name: 'routing-service', | ||
initialize(application) { | ||
// Register the routing service... | ||
application.register('service:-routing', RoutingService); | ||
// Then inject the app router into it | ||
application.inject('service:-routing', 'router', 'router:main'); | ||
} | ||
initialize | ||
}); | ||
}); |