Allows us to easily define routes in plugins

This commit is contained in:
Robin Ward 2014-12-09 13:26:30 -05:00
parent cebb47134f
commit 2b817f826b
1 changed files with 3 additions and 1 deletions

View File

@ -71,8 +71,10 @@ export default Ember.DefaultResolver.extend({
customResolve: function(parsedName) {
// If we end with the name we want, use it. This allows us to define components within plugins.
var suffix = parsedName.type + 's/' + parsedName.fullNameWithoutType,
dashed = Ember.String.dasherize(suffix),
moduleName = Ember.keys(requirejs.entries).find(function(e) {
return e.indexOf(suffix, e.length - suffix.length) !== -1;
return (e.indexOf(suffix, e.length - suffix.length) !== -1) ||
(e.indexOf(dashed, e.length - dashed.length) !== -1);
});
var module;