question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Angular 2 `entity` sub-generator generated resources using angularjs 1 fileset.

See original GitHub issue
Overview of the issue

When using entity or import-jdl sub-generator with Angular 2. The wrong file set (for angularjs 1.x) always been picked and resources generated as following:

Unable to find src/main/webapp/app/layouts/navbar/navbar.html or missing required jhipster-needle. Reference to book not added to menu.

   create .jhipster/Book.json
   create src/main/resources/config/liquibase/changelog/20170122164545_added_entity_Book.xml
...
   create src/main/webapp/app/entities/book/book.state.js
   create src/main/webapp/app/entities/book/book.controller.js
   create src/main/webapp/app/entities/book/book-dialog.controller.js
   create src/main/webapp/app/entities/book/book-delete-dialog.controller.js
   create src/main/webapp/app/entities/book/book-detail.controller.js
   create src/main/webapp/app/entities/book/book.service.js
   create src/main/webapp/i18n/zh-tw/book.json
Motivation for or Use Case

Since I chosen the Angular 2 as client framework, entity generation should generate the right file set.

Reproduce the error
  1. yo jhipster, select angular2 and left all options as-is.
  2. yo jhipster:entity book, set field 1 to title: String and left all options as-is.
Related issues

I did’t find any related issues about this breakage, but found a few issues saying this feature is complete.

Suggest a Fix

I’m willing to contribute, can somebody instruct me how to tracing/debugging the yo generating process. Or advice me how can I help resolving this issue.

JHipster Version(s)

Current master branch. ( https://github.com/jhipster/generator-jhipster/commit/c06e8f77c05fac03f4c37f98006ae0318fe16775 actually)

JHipster configuration, a .yo-rc.json file generated in the root folder
{
  "generator-jhipster": {
    "jhipsterVersion": "3.12.2",
    "baseName": "test",
    "packageName": "test",
    "packageFolder": "test",
    "serverPort": "8080",
    "authenticationType": "session",
    "hibernateCache": "ehcache",
    "clusteredHttpSession": false,
    "websocket": false,
    "databaseType": "sql",
    "devDatabaseType": "h2Disk",
    "prodDatabaseType": "mysql",
    "searchEngine": false,
    "messageBroker": false,
    "buildTool": "maven",
    "enableSocialSignIn": false,
    "rememberMeKey": "139eaa68445b71b513f9c365b6b8030d14712c5f",
    "useSass": false,
    "clientPackageManager": "yarn",
    "applicationType": "monolith",
    "clientFramework": "angular2",
    "testFrameworks": [],
    "jhiPrefix": "jhi",
    "enableTranslation": true,
    "nativeLanguage": "zh-tw",
    "languages": [
      "zh-tw"
    ]
  }
}
Entity configuration(s) entityName.json files generated in the .jhipster directory

Book.json

{
    "fluentMethods": true,
    "relationships": [],
    "fields": [
        {
            "fieldName": "title",
            "fieldType": "String"
        }
    ],
    "changelogDate": "20170122164545",
    "dto": "no",
    "service": "no",
    "entityTableName": "book",
    "pagination": "no"
}

Browsers and Operating System

java version “1.8.0_112” Java™ SE Runtime Environment (build 1.8.0_112-b16) Java HotSpot™ 64-Bit Server VM (build 25.112-b16, mixed mode)

git version 2.11.0

node: v7.4.0

npm: 4.0.5

yeoman: 1.8.5

yarn: 0.19.1

Docker version 1.13.0, build 49bf474

docker-compose version 1.10.0, build 4bd6f1a

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
gmarzioucommented, Jan 22, 2017

Don’t worry, it happened to me last week too 😉

0reactions
tan9commented, Jan 22, 2017

@jdubois , I finally got why the project’s version number still stick to 3.12.2. Is it possible to distinguish from project version to template version, so that one can be more easily aware of the version they used?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using AngularJS - JHipster.io - wlsun
Using the entity sub-generator to create a new entity called Foo generates the following front-end files under src/main/webapp : webapp ├── app │...
Read more >
How to edit entity and add pagination in Jhipster generated ...
Now I want to implement pagination instead of infinite scroll. Should I overwrite the entities? angularjs · jhipster · Share.
Read more >
AngularJS to Angular concepts: Quick reference
The following table lists some of the key AngularJS template features with their corresponding Angular template syntax. Bindings / interpolation → bindings / ......
Read more >
generator-pebble - npm Package Health Analysis
This will create both AngularJS and Express files supporting full CRUD functionality, and add the Karma and Mocha tests. Note: Don't forget to...
Read more >
Using Angular
Our development workflow for an Angular 2+ application is as below, use ... Using the entity sub-generator to create a new entity called...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found