Reputation: 62714
How do you properly add new directives/components in a jhipster project? I see that you can run commands to generate entities and services, but no directives.... what is the proper way to do this?
yo jhipster:service bar
yo jhipster:entity <entityName>
I don't see anything for yo jhipster:directive or yo jhipster:component. How do I create a directive/component?
Upvotes: 1
Views: 3006
Reputation: 15596
Just to provide more specifics, with JHipster 4 and angular 2 you can use the regular angular-cli as follows to create a directive:
cd /App/src/main/webapp/app/home
ng g directive <NAME-OF-YOUR-DIRECTIVE>
This will create two files: *.directive.ts and *.directive.spec.ts
It may also modify the module file (or you may have to modify it manually e.g. you may have to modify home.module.ts to add references to the newly created directive).
Upvotes: 0
Reputation: 16294
No there is no sub generator for directive or component assuming you're talking about JHipster 3 and angular 1.x. The entity sub generator generates both server and client code, there's no sub generator for client code only.
With JHipster 4 and angular 2, you will be able to use angular-cli for this kind of small operations on client code.
Upvotes: 1