小编raf*_*cik的帖子

角度示意图条件属性/提示

我正在努力创建自己的原理图。该原理图将负责使用一些代码创建一个组件(容器)。该组件的模板将包含一些其他组件。该组件之一是可选的横幅组件。该横幅将显示将被翻译成其他语言的文本,因此如果该横幅将包含在组件中,我还应该要求用户提供(默认)翻译文本。以下是该模板的示例:

name@dasherize .component.html.template:

<% if (includeBanner) { %>
<app-banner [title]="'<%= translationModuleKey %>.banner.title' | translate"
                           [description]="'<%= translationModuleKey %>.banner.description' | translate">
</app-banner>
<% } %>
<app-other-component>

</app-other-component>
Run Code Online (Sandbox Code Playgroud)

这是我的 schema.json:

{
  "$schema": "http://json-schema.org/schema",
  "id": "MySchematics",
  "title": "My schematics",
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "The name of the container",
      "x-prompt": "Container name"
    },
    "includeBanner": {
      "type": "boolean",
      "description": "Include banner",
      "default": "true",
      "x-prompt": "Include banner"
    },
    "bannerTitle": {
      "type": "string",
      "description": "Banner title",
      "x-prompt": "Banner title"
    },
    "bannerDescription": {
      "type": …
Run Code Online (Sandbox Code Playgroud)

javascript typescript angular angular-schematics

8
推荐指数
1
解决办法
1395
查看次数