简体   繁体   English

Prime ng p-inplace 内容和显示模板未显示

[英]Prime ng p-inplace content and display templates are not showing

I'm working with p-inplace of primeNg and I am using primeg version 14.1.2 .我正在使用 primeNg 的 p-inplace 并且我正在使用 primeg 版本14.1.2 But unfortunately, there is nothing showing inside the ng-template for both content and display.但不幸的是,在 ng-template 中没有显示内容和显示内容。 Does anybody have any idea how to solve this?有人知道如何解决这个问题吗?

I am attaching the stackblitz url - https://stackblitz.com/edit/angular-r9l7kg?file=src/main.ts我附上了 stackblitz url - https://stackblitz.com/edit/angular-r9l7kg?file=src/main.ts

I have found the solution, Instead of ng-template we have to use the component selectors.我找到了解决方案,我们必须使用组件选择器而不是ng-template Because there are two separate components one for display and another for content.因为有两个独立的组件,一个用于显示,另一个用于内容。 So I have changed the HTML to something like this -所以我把 HTML 改成了这样的 -

<p-inplace>
   <span pInplaceDisplay> Click to Edit </span>
   <span pInplaceContent>
      <input type="text" [value]="rowData[col.field]" pInputText />
   </span>
</p-inplace>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM