Skip to content

Instantly share code, notes, and snippets.

@tylergaw
Last active August 29, 2015 14:10
Show Gist options
  • Select an option

  • Save tylergaw/cd1f28f60a838c24aef8 to your computer and use it in GitHub Desktop.

Select an option

Save tylergaw/cd1f28f60a838c24aef8 to your computer and use it in GitHub Desktop.
ember-cli generate controller with type option

In the Ember cli docs it states that you can specify the --type option when generating a controller.

From the docs at http://www.ember-cli.com/#detailed-list-of-blueprints-and-their-use

Controller

  • Generates a Controller of a given name and type, with accompanying test.
  • Options
    • Type
      • Basic
      • Default
      • Object
      • Array
  • ember generate controller users --type array

I have ember-cli 0.1.3 installed.

Running:

ember generate controller users --type array

says:

The option '--type' is not supported by the generate command. Run ember generate --help for a list of supported options.

running ember help generate:

...
controller <name>
  Generates a controller of the given type.
...

does not specific that the --type option can be specified.

More info:

@tylergaw
Copy link
Author

tylergaw commented Dec 3, 2014

Tracking this down.

From the 0.1.3 changelog: "As part of the Ember 2.0 push remove controller types."
https://github.com/stefanpenner/ember-cli/releases/tag/v0.1.3

Looking for the code...

@tylergaw
Copy link
Author

tylergaw commented Dec 3, 2014

OK, this has definitely been removed: ember-cli/ember-cli@a264b5d

The Ember-cli docs need updated to reflect the changes.

@taras
Copy link

taras commented Dec 3, 2014

It looks like changes inline with Ember dropping different controller types. It's now encouraged to use Ember.Controller class to define your controller.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment