Hernan Hernan - 2 months ago 108
Jade Question

Jade/Pug with Angular 2 - how to resolve conflict with # syntax?

Jade input

div(#menu class="ui dropdown icon item")

Html output

<div #menu="#menu" class="ui dropdown icon item">

#menu="#menu" is wrong, the output i was expecting was just #menu.

<div #menu class="ui dropdown icon item">

The issue:

Angular's template reference variables are in conflict with jade's #idname syntax.

Version Infomation:

  • Jade 1.11.0

  • Angular 2 rc4


You should normally be able to fix it by explicitly telling Jade compiler to HTML5 doctype:

doctype html
div(#menu class="ui dropdown icon item")