1
votes

Ember Appkit seems really straight forward but I'm kind of confused on the file resolution. From the Getting Started Guide it sounds like you are just supposed to be able to place your file in the respective folder export your class and everything should just work. Is this assumption correct? If so it does not work for me. The only way I can get this to work is the following.

app/controllers/ApplicationController.js

var ApplicationController = Ember.Controller.extend();

export default ApplicationController;

app/app.js

import Resolver from 'resolver';
import ApplicationController from 'appkit/controllers/ApplicationController';

var App = Ember.Application.create({
  LOG_ACTIVE_GENERATION: true,
  LOG_VIEW_LOOKUPS: true,
  modulePrefix: 'appkit', // TODO: loaded via config
  Resolver: Resolver
});

App.ApplicationController = ApplicationController;

import routes from 'appkit/routes';
App.Router.map(routes); // TODO: just resolve the router

export default App;

From the guides it sounds like I shouldn't have to import the ApplicationController in the app.js file. I would like to know if I'm doing it wrong or not. Also if there is just a sample app using app kit that would be useful too.

1

1 Answers

3
votes

The pattern for importing Ember components into the app.js and then inserting into App.xxx global namespace is a workaround for ember-data models.

In order to resolve your application controller as an ember module, you need to rename your file to controllers/application.js

Otherwise it looks good