sir_thursday
sir_thursday

Reputation: 5419

ng-including a .jade template

header.jade

div(ng-controller="HeaderCtrl" class="header")
  <div class="logo">intquest</div>

  div(class="header-actions")

    if (user)
      <a href="/#/random">Random</a>
      <a href="/#/add">Add question</a>

    if (!user)
      <a href="/#/register">Register</a>
      <a href="/#/login">Login</a>

Here's a partial that I'm including on an .html page with <div ng-include src="'views/partials/header.jade'"></div>. It keeps rendering the 'jade' as HTML text... how can I get it to render as jade?

Upvotes: 0

Views: 293

Answers (1)

mpm
mpm

Reputation: 20155

<div ng-include src="'views/partials/header.jade'"></div>

you cant do that,your template must be in html.You could create a new directive that would process jade files though.But you cant do that directly with ngInclude.

Remember that angularjs is a clientside framework. the jade templating you'd use with express or node wont magically execute on the client,you need to return html from the server.

Upvotes: 1

Related Questions