Inject store in components
This commit is contained in:
		
							parent
							
								
									99a4051342
								
							
						
					
					
						commit
						15b31f7c8a
					
				
					 2 changed files with 31 additions and 0 deletions
				
			
		
							
								
								
									
										8
									
								
								app/initializers/component-store.js
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										8
									
								
								app/initializers/component-store.js
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,8 @@
 | 
			
		|||
export function initialize(container, application) {
 | 
			
		||||
  application.inject('component', 'store', 'store:main');
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
  name: 'component-store',
 | 
			
		||||
  initialize: initialize
 | 
			
		||||
};
 | 
			
		||||
							
								
								
									
										23
									
								
								tests/unit/initializers/component-store-test.js
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										23
									
								
								tests/unit/initializers/component-store-test.js
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,23 @@
 | 
			
		|||
import Ember from 'ember';
 | 
			
		||||
import { initialize } from '../../../initializers/component-store';
 | 
			
		||||
import { module, test } from 'qunit';
 | 
			
		||||
 | 
			
		||||
var container, application;
 | 
			
		||||
 | 
			
		||||
module('Unit | Initializer | component store', {
 | 
			
		||||
  beforeEach: function() {
 | 
			
		||||
    Ember.run(function() {
 | 
			
		||||
      application = Ember.Application.create();
 | 
			
		||||
      container = application.__container__;
 | 
			
		||||
      application.deferReadiness();
 | 
			
		||||
    });
 | 
			
		||||
  }
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
// Replace this with your real tests.
 | 
			
		||||
test('it works', function(assert) {
 | 
			
		||||
  initialize(container, application);
 | 
			
		||||
 | 
			
		||||
  // you would normally confirm the results of the initializer here
 | 
			
		||||
  assert.ok(true);
 | 
			
		||||
});
 | 
			
		||||
		Reference in a new issue