Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

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

angular.module('myApp', []).   config(['$routeProvider', function($routeProvider) {   $routeProvider.       when('/', {templateUrl: 'partials/some.jade',  controller: myAppController}).             otherwise({redirectTo: '/login'}); }]); 

Is it possible to render a jade file as a partial in angular?

like image 295
Sangram Singh Avatar asked Sep 11 '13 16:09

Sangram Singh


1 Answers

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.

like image 52
Sangram Singh Avatar answered Sep 23 '22 18:09

Sangram Singh