如何删除#!来自平均 js 应用程序的 urls?

how to remove #! from the urls of mean js application?

意味着在 default.how 上启用了 js 深层链接以删除 #!在平均 js 应用程序的 url 中?我尝试使用删除 public/application.js 中的以下行。

$locationProvider.hashPrefix('!');

并将以下行添加到 public/application.js.

$locationProvider.html5Mode(true);

但是当我键入 url http://localhost:3000/articles 以访问文章列表视图时,它会显示带有文章 json 对象数组的端点。

总之我找到了问题的答案。添加

$locationProvider.html5Mode(true);

到 config/application.js.and 添加

 <base href="/">

到app/views/layout.server.view.html.

并添加

var core = require('../app/controllers/core.server.controller');
app.get('/*', core.index);

到 express.js 文件。