Is it possible to render x.jade partial in angular?

前端 未结 1 809
闹比i
闹比i 2020-12-24 07:50

The following code works if i was rendering some.html instead of some.jade.

angular.module(\'myApp\', []).
  config([\'$routeProv         


        
相关标签:
1条回答
  • 2020-12-24 07:57

    Yes it is possible. Look at the following link

    Two important points to note are:

    1. templateUrl: 'partials/some' instead of templateUrl: 'partials/some.jade' and
    2. Add the following in routes: ( the code is for expressjs in node)

      app.get('/partials/:name', function (req, res)
       { var name = req.params.name;
         res.render('partials/' + name);
      });`
      
    3. Quit and relaunch node/express server.

    0 讨论(0)
提交回复
热议问题