I would like to add a custom view to jhipster app on index.html
I already created the link in navbar.html and added the html file on path src/main/webapp/scripts/app/custom/newView.html
<a ui-sref="newView" data-toggle="collapse" data-target=".navbar-collapse.in">
<span class="glyphicon"></span>
<span class="hidden-sm">new view</span>
</a>
When I click on the link it doesn't work. Probably it needs a custom route in angular but I can't figure out how to create it. What else should I do?
The simplest way to customize how your JHipster application looks like is by overriding CSS styles in src/main/webapp/content/css/global.css, or if you selected the Sass option, the src/main/webapp/content/scss/global.scss file.
The JHipster client code can be found under src/main/webapp, and follows closely the Angular style guide. Please read this guide first if you have any question on our application structure, file names, TypeScript conventions… This style guide is endorsed by the Angular team, and provides best practices that every Angular project should follow.
1 Separating the JHipster layout from a custom UI implementation 2 Replacing JHipster UI components (Part 1. Navbar) 3 Replacing JHipster UI components (Part 2. Adding SideNavbar and customizing more components) 4 Customizing JHipster + Vuejs CRUD with the Appworks Layout
Angular CLI is a tool to develop, scaffold and maintain Angular applications. JHipster generates the Angular CLI configuration file, so the Angular CLI workflows work with JHipster. This integration is done by generating a angular.json file in the application root folder and adding its dependencies in the package.json file.
In addition to the other answer, here is another piece of information. Maybe somebody else will find it useful. I had a similar problem with a custom view but only in production. Everything was fine in dev mode. In production mode, nothing would display and I had this javascript error that read "could not resolve ... from state ...". It turns out that my javascript file (where the state was declared) was declared like this in index.html
<!-- build:js({.tmp,src/main/webapp}) scripts/app.js -->
<script src="scripts/app/app.js"></script>
<script src="scripts/app/app.constants.js"></script>
...
<!-- endbuild -->
<!-- custom -->
<script src="scripts/app/pages/quizz/quizz.js"></script>
<script src="scripts/app/pages/quizz/quizz.controller.js"></script>
I had created the separation on purpose, just to make it easier to read. Once I moved it up to have it before endbuild, the problem disappeared. I guess this is related to how the app is packaged somehow? I haven't looked at how it does it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With