javascript - Mean stack 中的 Angular html5 模式

标签 javascript angularjs node.js express mean-stack

routes.js

app.route('/*')
    .get(indexController.render);

indexController.js

exports.render=function(req, res){

        res.render('index');

    }

config.js

$locationProvider.html5Mode(true);

我正在尝试在我的平均应用程序中实现 html5 模式。这不起作用。有什么问题吗

最佳答案

exports.render=function(req, res){
    //Your path to the html with .html
    res.render('index.html');
}

关于javascript - Mean stack 中的 Angular html5 模式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34756736/

相关文章:

angularjs - 我可以继承父 Controller 的变量吗?

Javascript 迭代哈希数组并获取键

node.js - 基于 SSE 的 Pub/Sub 经纪商

javascript - 创建一个函数来组合嵌套数组而无需递归

javascript - 将 img src 替换为 js jquery

javascript - UIWebView 中的触摸

javascript - 使用angularjs单击2个结果div后,在2个div之间画一条线

javascript - Uncaught Error : [$injector:cdep] Circular dependency found: $templateRequest <- $animate <- cfpLoadingBar <- $http <- $templateRequest <- $compile

javascript - 如何使用 Node 电子邮件模板作为初始化/操作样式对象?

javascript - 如何在 PWA 中显示共享照片?