0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

ember-cli generate command help list

Last updated at Posted at 2015-04-01

イシュー

  • ember generate コマンドのhelp

ember help generate

$ ember help generate
Requested ember-cli commands:

ember generate <blueprint> <options...>
  Generates new code from blueprints.
  aliases: g
  --dry-run (Boolean) (Default: false)
    aliases: -d
  --verbose (Boolean) (Default: false)
    aliases: -v
  --pod (Boolean) (Default: false)
    aliases: -p


  Available blueprints:
    ember-addon:
      ember-data <name>
    ember-cli-qunit:
      ember-cli-qunit <name>
    ember-cli:
      acceptance-test <name>
        Generates an acceptance test for a feature.
      adapter <name> <options...>
        Generates an ember-data adapter.
        --base-class
      adapter-test <name>
        Generates an ember-data adapter unit test
      addon <name>
        The default blueprint for ember-cli addons.
      app <name>
        The default blueprint for ember-cli projects.
      blueprint <name>
        Generates a blueprint and definition.
      component <name>
        Generates a component. Name must contain a hyphen.
      component-addon <name>
        Generates a component. Name must contain a hyphen.
      component-test <name>
        Generates a component unit test.
      controller <name>
        Generates a controller.
      controller-test <name>
        Generates a controller unit test.
      helper <name>
        Generates a helper function.
      helper-test <name>
        Generates a helper unit test.
      http-mock <endpoint-path>
        Generates a mock api endpoint in /api prefix.
      http-proxy <local-path> <remote-url>
        Generates a relative proxy to another server.
      in-repo-addon <name>
        The blueprint for addon in repo ember-cli addons.
      initializer <name>
        Generates an initializer.
      initializer-test <name>
        Generates an initializer unit test.
      lib <name>
        Generates a lib directory for in-repo addons.
      mixin <name>
        Generates a mixin.
      mixin-test <name>
        Generates a mixin unit test.
      model <name> <attr:type>
        Generates an ember-data model.
      model-test <name>
        Generates a model unit test.
      resource <name>
        Generates a model and route.
      route <name> <options...>
        Generates a route and registers it with the router.
        --type=route|resource (Default: route)
          aliases: -route (--type=route), -resource (--type=resource)
        --path (Default: )
      route-test <name>
        Generates a route unit test.
      serializer <name>
        Generates an ember-data serializer.
      serializer-test <name>
        Generates a serializer unit test.
      server <name>
        Generates a server directory for mocks and proxies.
      service <name>
        Generates a service and initializer for injections.
      service-test <name>
        Generates a service unit test.
      template <name>
        Generates a template.
      test-helper <name>
        Generates a test helper.
      transform <name>
        Generates an ember-data value transform.
      transform-test <name>
        Generates a transform unit test.
      util <name>
        Generates a simple utility module/function.
      util-test <name>
        Generates a util unit test.
      view <name>
        Generates a view subclass.
      view-test <name>
        Generates a view unit test.
$ 

実行コマンド

$ ember g model place name:string
実行結果
installing
  create app/models/place.js
installing
  create tests/unit/models/place-test.js
$ 
生成ファイル
  • app/models/place.js
import DS from 'ember-data';

export default DS.Model.extend({
  name: DS.attr('string')
});

実行コマンド

$ ember g route places
実行結果
installing
  create app/routes/places.js
  create app/templates/places.hbs
installing
  create tests/unit/routes/places-test.js
$ 
生成ファイル
  • app/routes/places.js
import Ember from 'ember';

export default Ember.Route.extend({
});
  • app/templates/places.hbs
{{outlet}}

参考

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?