Skip to content

Commit

Permalink
A more flexible service injection pattern
Browse files Browse the repository at this point in the history
If we have something like `const { inject: { service } } = Ember`, both
`Ember` and `inject` become optional.
  • Loading branch information
AndrewRadev committed Jul 24, 2016
1 parent 64bdc21 commit c7aca6d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion autoload/ember_tools/gf.vim
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ function! s:FindService(property)
let service_name = split(property, '\.')[0]
let dasherized_service_name = ember_tools#util#Dasherize(service_name)

if search('^\s*'.service_name.':\s*Ember\.inject\.service()', 'bcWn')
if search('^\s*'.service_name.':\s*\%(Ember\.\)\=\%(inject\.\)\=service()', 'bcWn')
return ember_tools#ExistingLogicFile('app/services/'.dasherized_service_name)
else
return ''
Expand Down

0 comments on commit c7aca6d

Please sign in to comment.