“Tombol Toggle di Bootstrap AngularJS” Kode Jawaban

Tombol Toggle di Bootstrap AngularJS

<a class="btn pull-right" 
   ng-class="{true: 'btn-primary', false: 'btn-danger'}[!patient.archived]"
   ng-click="patient.archived = !patient.archived">
  {{!patient.archived && 'Archive' || 'Unarchive'}} patient
</a>
Philan ISithembiso

Toggle Tombol Gaya Angular

@import '~@angular/material/theming';

@include mat-core();

$app-primary: mat-palette($mat-indigo);
$app-accent:  mat-palette($mat-pink, A200, A100, A400);

$app-theme: mat-light-theme($app-primary, $app-accent);

@mixin mix-app-theme($app-theme) {
  $primary: map-get($app-theme, primary);
  $accent: map-get($app-theme, accent);

  .mat-button-toggle {
    background-color: mat-color($primary);
    color: mat-color($primary, default-contrast);
  }

  .mat-button-toggle-checked {
    background-color: mat-color($accent);
    color: mat-color($accent, default-contrast);
  }
}

// Include the mixin
@include mix-app-theme($app-theme);
2 Programmers 1 Bug

Jawaban yang mirip dengan “Tombol Toggle di Bootstrap AngularJS”

Pertanyaan yang mirip dengan “Tombol Toggle di Bootstrap AngularJS”

Lebih banyak jawaban terkait untuk “Tombol Toggle di Bootstrap AngularJS” di JavaScript

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya