Hot.PxL
Hot.PxL

Reputation: 1990

AngularJS partials in Jade using boolean attributes

I am using AngularJS together with Jade. Suppose I have a "partial" as follows.

h1 State 1
div(ui-view)

This is a standalone Jade file, and the problem is when it is compiled, since it is not specified a doctype, it compiles into the following.

<h1>State 1</h1>
<div ui-view="ui-view"></div>

The boolean option ui-view being mirrored into ui-view="ui-view" is problematic for AngularJS. AngularJS do not recognize it if it is mirrored. The problem lies within Jade, because I did not specify doctype html, so Jade does not know it is HTML5 and hence the problem. On the other hand, it is a "partial" and I cannot specify doctype inside it.

I use Grunt to compile everything and it seems I am not able to specify an option through Grunt to Jade.

How can I get this ui-view correct?

Upvotes: 0

Views: 65

Answers (1)

Maverick
Maverick

Reputation: 3059

Pass in an options object when you call your jade compile or render and include {doctype: 'html'}

Upvotes: 1

Related Questions