2014-09-26 3 views
1

각 루프 내에서 JSON 객체를 기반으로 조건부를 실행하려고하는 jade 템플릿 파일이 있습니다. if 문을 작동 시키려면 무엇을 잘못하고 있습니까? 내가Jade 템플릿 if 문

if "URGENT" == "URGENT" 

에 조건을 변경하는 경우

   each content in result.content 
        .panel.panel-default.result 
        .panel-heading.clearfix 
         a.gray(href='/content/#{content.id}') #{content.created_pretty} 
         a.btn.btn-primary.btn-sm.view(href="/content/#{content.id}") View 
         .status 
         .well 
          span.label.label-default #{content.priority} 
         if "#{content.priority}" == "URGENT" 
          .well 
          span.badge ! 

코드는 성공적으로 실행 않습니다.

는 또한 시도 :

if '"#{content.priority}" == "URGENT"' 
- if ("#{content.priority}" == "URGENT") 

은 어떤 HLP는 크게 감사하겠습니다!

답변

3

당신은

if content.priority == "URGENT" 

대신

if "#{content.priority}" == "URGENT" 
해야