Html 如何使用Nebular,nb select设置预选选项

Html 如何使用Nebular,nb select设置预选选项,html,angular,nebular,Html,Angular,Nebular,加载页面时是否可能有预选值 [(selected)]='' 这就是我必须在中添加的内容,请尝试以下操作: <nb-select id="theme" [selected]="currentTheme" (selectedChange)="changeTheme($event)" status="primary"> <nb-select-label [innerHtml]="selectedTheme"></nb-select-label>

加载页面时是否可能有预选值

[(selected)]=''
这就是我必须在
中添加的内容,请尝试以下操作:

<nb-select id="theme" [selected]="currentTheme" (selectedChange)="changeTheme($event)" status="primary">
        <nb-select-label [innerHtml]="selectedTheme"></nb-select-label>
        <nb-option langg *ngFor="let theme of themes" [value]="theme.value"> {{ theme.name | langg }}</nb-option>
      </nb-select>

{{theme.name | langg}}
存在一个,但对于静态数据,它的工作原理与您提到的文档中的描述相同:

HTML:

<nb-select placeholder="Select Showcase" [(selected)]="selectedItem">
      <nb-option value="">Option empty</nb-option>
      <nb-option value="0">Option 0</nb-option>
      <nb-option value="1">Option 1</nb-option>
      <nb-option value="2">Option 2</nb-option>
      <nb-option value="3">Option 3</nb-option>
      <nb-option value="4">Option 4</nb-option>
    </nb-select>

选项为空
选项0
选择1
选择2
选择3
选择4
TS:
selectedItem='2'

不起作用。。。见问题: