ng-view not working with partials in AngularJS/Express

后端 未结 3 856
忘掉有多难
忘掉有多难 2021-01-19 00:14

Everything was working until I tried to display a partial file in ng-view.

/public/app/app.js

angular.module(\'app\', [\'ngResource\         


        
3条回答
  •  终归单人心
    2021-01-19 00:56

      app.get('*', function(req, res,next) {
         if(req.xhr != true)
           {
             res.render('index');
           } else
           {
           next();
        }
            });
    

    modify like this

提交回复
热议问题