Last active
January 10, 2016 05:17
-
-
Save hibariya/bc8eda6659978964e198 to your computer and use it in GitHub Desktop.
Container returns falsy value as undefined on 2nd or later lookup
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
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
appName:'Ember Twiddle', | |
inspectLookup() { | |
return Ember.inspect(this.container.lookup('falsy:false')); | |
}, | |
firstLookup: Ember.computed(function() { | |
return `1st lookup: ${this.inspectLookup()}`; | |
}), | |
secondLookup: Ember.computed(function() { | |
return `2nd lookup: ${this.inspectLookup()}`; | |
}) | |
}); |
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
export function initialize(container, application) { | |
application.register('falsy:false', false, { instantiate: false }); | |
} | |
export default { | |
name: 'application-init', | |
initialize: initialize | |
}; |
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
{ | |
"version": "0.5.0", | |
"EmberENV": { | |
"FEATURES": {} | |
}, | |
"options": { | |
"enable-testing": false | |
}, | |
"dependencies": { | |
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js", | |
"ember": "canary", | |
"ember-data": "https://cdnjs.cloudflare.com/ajax/libs/ember-data.js/2.2.0/ember-data.js", | |
"ember-template-compiler": "canary" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment