【问题标题】:Remove # hashtag from angular 1.5 url从 angular 1.5 url 中删除 # hashtag
【发布时间】:2018-11-07 17:19:17
【问题描述】:

我正在尝试使用 locationProvider 从我的 Angularjs 应用程序的 URL 中删除主题标签,并且在我手动刷新页面之前它运行良好。当我刷新页面时,我的 angularjs js 和 css 文件现在正在加载。 请帮助我。

在 index.jsp 中

App.js

myapp.config(function($routeProvider, USER_ROLES, IdleProvider, KeepaliveProvider, $locationProvider) { $locationProvider.html5Mode(true); }

urlrewrite.xml

/login 资源/partials/login.html /login/brandname 资源/partials/login.html /home 资源/partials/home.html

web.xml:

http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" version="3.0"> 原型创建的 Web 应用程序 UrlRewriteFilter org.tukey.web.filters.urlrewrite.UrlRewriteFilter confPath /WEB-INF/ urlrewrite.xml UrlRewriteFilter /* 请求转发

【问题讨论】:

  • 大家好,请帮我解决上述问题。
  • 您必须在 index.html 中添加带有基本 url 的基本标签
  • 嗨,卡迪尔,感谢您的回复。我在下面添加了 但遇到了同样的问题
  • @Protozoid ,我正在关注同样提到的 url,但是当我刷新页面时,它没有加载我的 angular js 文件和 css。

标签: angularjs spring-4


【解决方案1】:

添加基本标签也可以帮助您解决# 问题。你也检查过这个链接吗? https://scotch.io/tutorials/pretty-urls-in-angularjs-removing-the-hashtag

【讨论】:

  • 嗨 Janno Tabamo ,我也检查了上面的链接。我也做了同样的事情。但是当我刷新页面时,我的 css 和 js 文件没有加载。
  • 您在后端使用nginx 吗?还是它只是纯粹的前端?你可能会找到一些帮助尝试检查这个问题stackoverflow.com/questions/41460772/…
  • 我在后端使用 spring 用于 rest api 和前端 angularjs。我也检查了上面的网址。请帮帮我
  • 我对春天不是很熟悉。但我希望这个链接可以帮助你stackoverflow.com/questions/24837715/…
  • 这是你后端路由配置的问题。
猜你喜欢
  • 2014-06-12
  • 2015-07-07
  • 2020-03-23
  • 1970-01-01
  • 2018-08-07
  • 1970-01-01
  • 2017-05-31
  • 2018-01-23
  • 1970-01-01
相关资源
最近更新 更多