0
votes

I've created a new app using Ember CLI

I have already run npm install ember-cli-coffeescript but when I convert files to coffeescript Ember does not recognize them. For example when I add a custom route .coffee file:

App.IndexRoute = Ember.Route.extend
  setupController: (controller) ->
    controller.set('title', "My App")

and create an index.hbs:

<h1>{{title}}</h1>

The dom renders with an empty h1 tag.

When I convert app.js to app.coffee:

`import Ember from 'ember'`
`import Resolver from 'ember/resolver'`
`import loadInitializers from 'ember/load-initializers'`
`import config from './config/environment'`

Ember.MODEL_FACTORY_INJECTIONS = true

App = Ember.Application.extend
  modulePrefix: config.modulePrefix,
  podModulePrefix: config.podModulePrefix,
  Resolver: Resolver


loadInitializers(App, config.modulePrefix)

`export default App`

The page does not load and I get "Uncaught Error: Could not find module app-name/app "

Anyone have any idea what's going on?

1

1 Answers

0
votes

The problem was was with my initial command:

npm install ember-cli-coffeescript

should be:

npm install --save-dev ember-cli-coffeescript

While the first command appears to do something it isn't the right thing. Don't forget the --save-dev flag