Angular 使用Jade或Pug模板制作Ioinic
翡翠/帕格:Angular 使用Jade或Pug模板制作Ioinic,angular,ionic-framework,pug,ionic2,Angular,Ionic Framework,Pug,Ionic2,翡翠/帕格: ion-nav([root]="rootPage", #content, swipeBackEnabled="false") Pug编译的HTML结果: <ion-nav [root]="rootPage" #content="#content" swipeBackEnabled="false"></ion-nav> 它应该是HTML格式的: <ion-nav [root]="rootPage" #content swipeBackEnable
ion-nav([root]="rootPage", #content, swipeBackEnabled="false")
Pug编译的HTML结果:
<ion-nav [root]="rootPage" #content="#content" swipeBackEnabled="false"></ion-nav>
它应该是HTML格式的:
<ion-nav [root]="rootPage" #content swipeBackEnabled="false"></ion-nav>
您认为我应该怎么做才能让帕格正确编译呢?您需要在模板的开头明确声明HTML5 doctype,如下所示:
doctype html
根据对的评论,只有在HTML5呈现模式下才支持不带值的属性,这意味着正确包含这些属性的唯一方法是使用HTML5 doctype。在ngFor和(单击)上加引号,如下所示:
button(ion-item '*ngFor'='let team of teams' '(click)'='itemTapped($event, team)')
p {{team.name}}
结果:
<button ion-item *ngFor="let team of teams" (click)="itemTapped($event, team)">
<p>{{team.name}}</p>
</button>
{{team.name}
您是否明确声明HTML5 doctype?根据后面的一条评论,在使用doctype html
后,该属性被正确呈现-可能是一个类似的问题?是的,你是对的。这样行吗?因为我很乐意把这篇文章作为对这个问题的正确回答,这样其他人也能从中受益:)是的,请这样做。