私はこのコードのビットを持っている私の角度テンプレートで:ブートストラップデータトグル属性が変更イベントを無効にします - 角度
<div class = "btn-group" data-toggle="buttons">
<input type="text" class = "form-control" [(ngModel)]="siteFilter[filterType]" placeholder="Refine Search">
<label class="btn btn-default">
<input type="radio" (change)="changeFilter('1')" autocomplete="off">1
</label>
<label class="btn btn-default active">
<input type="radio" (change)="changeFilter('2')" autocomplete="off" checked>2
</label>
<label class="btn btn-default">
<input type="radio" (change)="changeFilter('3')" autocomplete="off">3
</label>
</div>
私はdata-toggle="buttons"
属性を使用すると、私の(change)="changeFilter()
をしても起動されません。 radio
プレスでdata-toggle
の機能を維持し、change
イベントトリガーを使用するにはどうすればよいですか?私がやってしまったことは、私の入力のそれぞれのためのフラグ変数を持っていた
あなたは[NG-ブートストラップ]を使用して検討すること(https://ng-bootstrap.github.io/#/home)(角度4 +ブートストラップ4)。 [NgbRadioGroup](https://ng-bootstrap.github.io/#/components/buttons/api)は、あなたが探している機能を提供します。 [コード例](https://ng-bootstrap.github.io/#/components/buttons/examples)を参照してください。 – ConnorsFan
はい、私は最初から 'ng-bootstrap'を使用していたはずですが、今はアプリケーション全体を変換する必要はありません。ブートストラップ3の残りの要素に影響を与えずに 'ng-bootstrap'を使う方法はありますか? – ecain
Bootstrapに多くの経験はありませんが、Bootstrap 3(CSS + jQuery)とng-bootstrap(Bootstrap 4 CSS、jQueryなし)を混在させることはできません。両者を混在させると、ng-bootstrapと[Bootstrap 4へのアップグレード](https://v4-alpha.getbootstrap.com/migration/)に変換するよりも複雑になる可能性があります。 – ConnorsFan