Creating new AngularJS component with Yeoman generator-ionic

After generating a new ionic app using Yeoman generator-ionic, I can't create a new AngularJS component (controller / route / directive etc').

I've tried yo generator-ionic:controller myController with no luck. Couldn't find anything in the docs too. what is the right way scaffolding new component?

This question is almost a year old. That said, someone else might find it and want an answer.

First, your syntax is wrong. When doing a yo xxxx you leave off the generator-. Second, the ionic generator doesn't have a sub-generator for making a controller. You can use the angular generator as a complement. If you don't have it, run npm install generator-angular -g and then you can do a yo angular:controller test. When I did that, it seemed to understand my main module just fine, but it put the controller in scripts/controller/test.js.

The angular sub-generators available are:

  • common
  • constant
  • controller
  • decorator
  • directive
  • factory
  • filter
  • main
  • provider
  • route
  • service
  • value
  • view