ember.js icon indicating copy to clipboard operation
ember.js copied to clipboard

Controller lookup problem

Open admin-4virtuals opened this issue 13 years ago • 1 comments

When I do App.__container__.lookup('controller:walletDeposit') I receive the controller that goes by the name App.WalletDepositController. If I do App.__container__.lookup('controller:wallet-deposit') it looks like I receive a auto generated controller. When I do App.__container__.lookup('controller:notacontroller') I get undefined.


Another thing to note is that if I do

aComputedFunction: function(){
    return 'something';
}.property('controllers.wallet-deposit.someValue'),

it updates exactly as expected.


For the longest time I was trying to access a controller value with controllers.wallet-deposit.someValue from a template (needs adjusted accordingly) and getting the initial value of null. When I used controllers.walletDeposit.someValue I got the correct value.

Is this a bug or a mistake on my part?

admin-4virtuals avatar Oct 05 '13 23:10 admin-4virtuals

You should always be using the same, normalized names. When working with Ember namespaces (App.WalletDepositController), you should use camel-cased names, not underscored or hyphenated names.

wycats avatar Oct 06 '13 06:10 wycats