Sure. Please find below.
Component
import { Component } from â@angular/coreâ;
import { NavController, NavParams } from âionic-angularâ;
@Component({
selector: âpage-const-appâ,
templateUrl: âconst-app.htmlâ,
})
export class ConstAppPage {
public isToggledone: boolean;
public isToggledtwo: boolean;
public isToggledthree: boolean;
public isToggledfour: boolean;
public isToggledfive: boolean;
public varscolor: string;
public myColorone: string;
public myColortwo: string;
public myColorthree: string;
public myColorfour: string;
public myColorfive: string;
constructor(public navCtrl: NavController, public navParams: NavParams) {
this.isToggledone = false;
this.isToggledtwo = false;
this.isToggledthree = false;
this.isToggledfour = false;
this.isToggledfive = false;
// this.varscolor = "#f53d3d";
// this.myColorone = 'danger';
// this.myColortwo = 'danger';
// this.myColorthree = 'danger';
// this.myColorfour = 'danger';
// this.myColorfive = 'danger';
}
public notify1() {
console.log("Toggled: "+ this.isToggledone);
if(this.isToggledone)
{
console.log("True Colors Updated: ");
this.myColorone = 'green';
}else {
console.log("False Colors Updated: ");
this.myColorone = 'danger';
}
}
public notify2() {
console.log("Toggled: "+ this.isToggledtwo);
console.log("Two Color Updated: ");
this.myColortwo = 'green';
}
public notify3() {
console.log("Toggled: "+ this.isToggledthree);
console.log("Three Color Updated: ");
this.myColorthree = 'green';
}
public notify4() {
console.log("Toggled: "+ this.isToggledfour);
console.log("Four Color Updated: ");
this.myColorfour = 'green';
}
public notify5() {
console.log("Toggled: "+ this.isToggledfive);
console.log("Five Color Updated: ");
this.myColorfive = 'green';
}
ionViewDidLoad() {
console.log(âionViewDidLoad ConstAppPageâ);
}
}
variables.scss
// Ionic Variables and Theming. For more info, please see:
// CSS Utilities for App Theming and Platform Style Configuration
// Font path is used to include ionicons,
// roboto, and noto sans fonts
$font-path: ââŚ/assets/fontsâ;
// The app direction is used to include
// rtl styles in your app. For more info, please see:
// http://ionicframework.com/docs/theming/rtl-support/
$app-direction: ltr;
//$red: #e74c3c;
@import âionic.globalsâ;
// Shared Variables
// --------------------------------------------------
// To customize the look and feel of this app, you can override
// the Sass variables found in Ionicâs source scss files.
// To view all the possible Ionic variables, see:
// Overriding Ionic Sass Variables
//$background-md-color: #f53d3d;
//.toggle-icon
//{
//background-color: #f53d3d;
//}
// Named Color Variables
// --------------------------------------------------
// Named colors makes it easy to reuse colors on various components.
// Itâs highly recommended to change the default colors
// to match your appâs branding. Ionic uses a Sass map of
// colors so you can add, rename and remove colors as needed.
// The âprimaryâ color is the only required color in the map.
$colors: (
primary: #488aff,
secondary: #32db64,
danger: #f53d3d,
light: #f4f4f4,
dark: #222,
green: #71e238,
customss: #e00404,
custom1: #19b698,
custom2: #7761a7,
custom3: #ea6153,
custom4: #4aa3df,
red: #e74c3c
);
// App iOS Variables
// --------------------------------------------------
// iOS only Sass variables can go here
// App Material Design Variables
// --------------------------------------------------
// Material Design only Sass variables can go here
// App Windows Variables
// --------------------------------------------------
// Windows only Sass variables can go here
// App Theme
// --------------------------------------------------
// Ionic apps can have different themes applied, which can
// then be future customized. This import comes last
// so that the above variables are used and Ionicâs
// default are overridden.
@import âionic.theme.defaultâ;
// Ionicons
// --------------------------------------------------
// The premium icon font for Ionic. For more info, please see:
// Ionicons v3: Open-Source Application Icons for iOS and Android
@import âionic.ioniconsâ;
// Fonts
// --------------------------------------------------
@import ârobotoâ;
@import ânoto-sansâ;
**Html:-**
<ion-header>
<ion-navbar padding hideBackButton="true">
<img src="assets/img/Smart_Scheduler_Logo.png">
</ion-navbar>
<ion-navbar >
<div class="scrollmenu">
<a (click) = dashPage()>Dashboard</a>
<a (click) = streamPage()>Stream</a>
<a (click) = adapterPage()>Adapter</a>
<a class="circle">Constant</a>
<a (click) = releasePage()>Release</a>
<a (click) = monitorPage()>Monitor</a>
</div>
</ion-navbar>
</ion-header>
<ion-content >
<ion-card >
<ion-item>
<ion-label> <span class="font-capp">SS Engine</span></ion-label>
<ion-toggle [color]="myColorone" [(ngModel)]="isToggledone" (ionChange)="notify1()" disabled="false"></ion-toggle>
</ion-item>
<ion-item>
<ion-label> <span class="font-capp">Logging Status</span></ion-label>
<ion-toggle [color]="myColortwo" [(ngModel)]="isToggledtwo" (ionChange)="notify2()" ></ion-toggle>
</ion-item>
<ion-item>
<ion-label > <span class="font-capp">Event Based Scheduling</span> </ion-label>
<ion-toggle [color]="myColorthree" [(ngModel)]="isToggledthree" (ionChange)="notify3()" ></ion-toggle>
</ion-item>
<ion-item>
<ion-label > <span class="font-capp">System Email Notification </span></ion-label>
<ion-toggle [color]="myColorfour" [(ngModel)]="isToggledfour" (ionChange)="notify4()" ></ion-toggle>
</ion-item>
<ion-item>
<ion-label > <span class="font-capp">Disable all jobs on Error</span></ion-label>
<ion-toggle [color]="myColorfive" [(ngModel)]="isToggledfive" (ionChange)="notify5()" ></ion-toggle>
</ion-item>
</ion-card>
</ion-content>