将自定义视图添加到jhipster应用 [英] Add custom view to jhipster app

查看:73
本文介绍了将自定义视图添加到jhipster应用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在index.html上向jhipster应用添加自定义视图

I would like to add a custom view to jhipster app on index.html

我已经在navbar.html中创建了链接,并将html文件添加到路径src/main/webapp/scripts/app/custom/newView.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?

推荐答案

除了其他答案,这里还有另一条信息.也许其他人会发现它有用.我在自定义视图中也遇到了类似的问题,但仅限于生产环境.在开发模式下一切都很好.在生产模式下,什么也不会显示,并且我遇到了这个JavaScript错误,显示为无法从状态...解析...". 原来,我的JavaScript文件(声明状态的文件)在index.html中声明了

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>

我故意创建了分隔,只是为了使其更易于阅读.一旦将它移到Endbuild之前,问题就消失了.我想这与应用程序的打包方式有关吗?我没看过它是怎么做的.

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.

这篇关于将自定义视图添加到jhipster应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆