Bootstrap 4 在代码中使用模板

Bootstrap 4 在代码中使用模板,bootstrap-4,Bootstrap 4,所以,如果我点击一个按钮,我想改变这个值。如果是西班牙语,我想看“你好”,如果是英语,我想看“你好” 因此,我的json文件如下所示: es.json { "hello": "hola" } { "hello": "hello en.json { "hello": "hola" } { "hello": "hello }在代码中的某个地方放一个这样的模板 <ng-template #buttonTp> <span tr

所以,如果我点击一个按钮,我想改变这个值。如果是西班牙语,我想看“你好”,如果是英语,我想看“你好”

因此,我的json文件如下所示:

es.json

{
    "hello": "hola"
}
{
    "hello": "hello
en.json

{
    "hello": "hola"
}
{
    "hello": "hello

}

在代码中的某个地方放一个这样的模板

    <ng-template #buttonTp>
      <span translate>hello</span>
    </ng-template>

你好
然后在你的领域

<button [tooltip]="buttonTp" translate> hello </button> 
你好
是的,因为我想您使用的是旧版本的ngbootstrap。不管怎样,我很高兴我能帮助你我很抱歉事情发展到这个地步