| 88 | }; |
| 89 | |
| 90 | function createApplication() { |
| 91 | if (this.app) return this.app; |
| 92 | |
| 93 | let app = this.Ember.Application.extend().create({ |
| 94 | autoboot: false, |
| 95 | Resolver: { |
| 96 | create: (specifier) => { |
| 97 | return this.registry[specifier]; |
| 98 | }, |
| 99 | }, |
| 100 | }); |
| 101 | |
| 102 | let Router = this.Ember.Router.extend({ |
| 103 | location: 'none', |
| 104 | }); |
| 105 | |
| 106 | if (this.routesCallback) { |
| 107 | Router.map(this.routesCallback); |
| 108 | } |
| 109 | |
| 110 | this.register('router:main', Router); |
| 111 | |
| 112 | registerApplicationClasses(app, this.registry); |
| 113 | |
| 114 | // Run application initializers |
| 115 | this.run(app, 'boot'); |
| 116 | |
| 117 | this.app = app; |
| 118 | |
| 119 | return app; |
| 120 | } |
| 121 | |
| 122 | function register(containerKey, klass) { |
| 123 | this.registry[containerKey] = klass; |