i have following jade code which works fine
div.container
h3.entry-title(style='margin-top:25px;') #{result.post_title}
div
p.text-left.pst <i class="fa fa-calendar"></i> #{result.post_date}
div.panel
!{result.post_content}
-if(typeof userType !== 'undefined' && userType=='admin')
a.btn.red.marginTop(href='/ebs' ) Cancel
div.page-footer
div.page-footer-inner
Copyright Copyright All rights reserved.
but when i try to insert if statement like below it gives me the indentation error
div.container
h3.entry-title(style='margin-top:25px;') #{result.post_title}
div
-if(result.post_date!='-1')
p.text-left.pst <i class="fa fa-calendar"></i> #{result.post_date}
div.panel
!{result.post_content}
-if(typeof userType !== 'undefined' && userType=='admin')
a.btn.red.marginTop(href='/ebs' ) Cancel
div.page-footer
div.page-footer-inner
Copyright Copyright All rights reserved.
If you are using Sublime text editor, you can go to View > Identation > Convert Identation to spaces.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With