In My ionic 3 app the tab bar is getting disappear when navigating from side bar. All other pages are working fine. Only when routing from side bar, tab is getting disappear.
Here is my app.html
<ion-menu [content]="content" type="overlay">
<ion-content class="menubar">
<ion-list class="mainmenu">
<div class="profile">
<ion-row>
<ion-col col-4><img src="./assets/imgs/wgs-logo.png" alt=""></ion-col>
<ion-col col-8 class="j-c-center" (click)="openLandingPage()">
<ion-icon slot="start" class="landing-page-icon" name="custom-landing-page"></ion-icon>
</ion-col>
</ion-row>
</div>
<ion-item no-lines class="menuitem" *ngFor="let cate of categoryFullData; let i = index;">
<button ion-button clear menuToggle (click)="opencategory(cate.id, cate.categry)">
<img src="{{baseUrlImage}}{{cate.cateimg}}">
<p>{{cate.categry}}</p>
</button>
<ion-icon slot="end" name="ios-arrow-down" class="icon-down-arrow" (click)="menuItemHandler(i)"></ion-icon>
<ion-item-group submenu [class.visible]="showSubmenu[i]">
<ion-item no-lines class="menuitem" *ngFor="let subcate of cate.subcategories; let i = index;">
<button ion-button clear (click)="opencategory(subcate.id, subcate.categry)" menuToggle>
<img src="{{baseUrlImage}}{{subcate.cateimg}}">
<p>{{subcate.categry}}</p>
</button>
</ion-item>
</ion-item-group>
</ion-item>
<ion-item no-lines class="menuitem">
<button ion-button clear menuToggle (click)="openLandingPage()">
Sell
</button>
</ion-item>
<ion-item no-lines class="menuitem">
<button ion-button clear menuToggle (click)="openAboutUs()">
<p>About Us</p>
</button>
</ion-item>
<ion-item no-lines class="menuitem">
<button ion-button clear menuToggle (click)="openTermsAndConditions()">
<p>Terms & Conditions</p>
</button>
</ion-item>
<ion-item no-lines class="menuitem">
<button ion-button clear menuToggle (click)="openPrivacyPolicy()">
<p>Privacy Policy</p>
</button>
</ion-item>
</ion-list>
</ion-content>
</ion-menu>
<ion-nav [root]="rootPage" #content swipeBackEnabled="false"></ion-nav>
Here is my app.component.ts
import { Component, ViewChild } from '#angular/core';
import { Nav, Platform, App, LoadingController, AlertController, ToastController } from 'ionic-angular';
import { StatusBar } from '#ionic-native/status-bar';
import { SplashScreen } from '#ionic-native/splash-screen';
import { NotificationsPage } from '../pages/notifications/notifications';
import { OrderHistoryPage } from '../pages/order-history/order-history';
import { ContactPage } from '../pages/contact/contact';
import { FeedbackPage } from '../pages/feedback/feedback';
import { HomePage } from '../pages/home/home';
import { OffersPage } from '../pages/offers/offers';
import { TermsPage } from '../pages/terms/terms';
import { HkApiproviderProvider } from '../providers/hk-apiprovider/hk-apiprovider';
import { CategoryPage } from '../pages/category/category';
import { LanguageServiceProvider } from '../providers/language-service/language-service';
import { TranslateService } from '#ngx-translate/core';
import { TabsPage } from '../pages/tabs/tabs';
import { ProductsPage } from '../pages/products/products';
import { LandingPage } from '../pages/landing-page/landing-page';
import { PrivacyPage } from '../pages/privacy/privacy';
#Component({
templateUrl: 'app.html'
})
export class MyApp {
#ViewChild(Nav) nav: Nav;
validEmail:any;
rootPage: any = TabsPage;
showSubmenu = [];
resposeData: any;
categoryFullData:any;
pages: Array<{title: string, component: any}>;
apptoken = {"token":""};
postData={
"user_id":"",
"token":"",
}
baseUrlImage: any;
itemsuperqty: number;
userDetails: any;
constructor(public platform: Platform, public auth:HkApiproviderProvider,public app:App, public toastCtrl: ToastController, public loadingCtrl:LoadingController, public alertCtrl:AlertController, public statusBar: StatusBar, public splashScreen: SplashScreen,public langserv : LanguageServiceProvider, translate: TranslateService) {
this.initializeApp();
this.apptoken.token = HkApiproviderProvider.gettoken();
localStorage.setItem('appconfig', JSON.stringify(this.apptoken));
langserv.getdefaultlang();
translate.setDefaultLang(langserv.defaultlang);
this.langserv.changelang('en');
this.itemsuperqty = 1;
this.baseUrlImage = auth.getimage();
if(localStorage.getItem('userData')){
const data = JSON.parse(localStorage.getItem('userData'));
this.userDetails = data.userData;
}
this.postData.token = HkApiproviderProvider.gettoken();
this.getcategorydata();
}
/* menuItemHandler(): void {
this.showSubmenu = !this.showSubmenu;
} */
initializeApp() {
this.platform.ready().then(() => {
this.statusBar.backgroundColorByHexString('#307722');
this.splashScreen.hide();
});
}
onclickHome(){
this.nav.setRoot(HomePage , { tabIndex: 0 });
}
onclickcategory(){
this.nav.push(CategoryPage , { tabIndex: 0 });
}
onclickMyOrder(){
this.nav.push(OrderHistoryPage , { tabIndex: 1 });
}
openContact(){
this.nav.push(ContactPage , { tabIndex: 0 });
}
onclickNoti(){
this.nav.push(NotificationsPage , { tabIndex: 0 });
}
openfeedback(){
this.nav.push(FeedbackPage , { tabIndex: 0 });
}
openoffers(){
this.nav.push(OffersPage , { tabIndex: 0 });
}
openterms(){
this.nav.push(TermsPage , { tabIndex: 0 });
}
openprivacy(){
this.nav.push(TermsPage , { tabIndex: 0 });
}
openLandingPage(){
this.nav.push(LandingPage);
}
checkLogin(){
if(localStorage.getItem('userData')){
return true;
}else{
return false;
}
}
menuItemHandler(index): void {
if(this.showSubmenu[index] && this.showSubmenu[index] == false) {
this.showSubmenu[index] = true;
} else if (this.showSubmenu[index] && this.showSubmenu[index] == true) {
this.showSubmenu[index] = false;
} else {
this.showSubmenu[index] = true;
}
}
public getcategorydata()
{
let zest = this.loadingCtrl.create({
content: "Getting Data..",
duration:20000,
spinner:'crescent'
});
zest.present();
this.auth.postData(this.postData, "getcategory").then((result) => {
this.resposeData = result;
this.categoryFullData = this.resposeData.Data;
//console.log(result);
zest.dismiss();
}, (err) => {
zest.dismiss();
});
}
opencategory(category, cname){
this.nav.push(ProductsPage,{
category : category,
cname : cname,
tabIndex: 1
});
}
openAboutUs() {
this.nav.push(ContactPage);
}
openTermsAndConditions() {
this.nav.push(TermsPage);
}
openPrivacyPolicy() {
this.nav.push(PrivacyPage);
}
}
This is my tabs.html page
<ion-tabs>
<ion-tab [root]="tab6Root" class="tab-bar" tabIcon="custom-landing-page">
</ion-tab>
<ion-tab [root]="tab1Root" class="tab-bar" tabIcon="ios-home-outline">
</ion-tab>
<ion-tab [root]="tab2Root" class="tab-bar" tabIcon="ios-person-outline">
</ion-tab>
<ion-tab [root]="tab3Root" class="tab-bar" tabIcon="icon-cart-white" [tabBadge]="cartCounterManager()">
</ion-tab>
<ion-tab [root]="tab4Root" class="tab-bar" tabIcon="ios-heart-outline" [tabBadge]="wishListCounterManager()">
</ion-tab>
<ion-tab [root]="tab5Root" class="tab-bar" tabIcon="ios-search-outline">
</ion-tab>
</ion-tabs>
tabs.component.ts
import { Component } from '#angular/core';
import { ProductSearchPage } from '../product-search/product-search';
import { ProfilePage } from '../profile/profile';
import { HomePage } from '../home/home';
import { CartPage } from '../cart/cart';
import { WishListPage } from '../wishlist/wishlist';
import { NavController, NavParams } from 'ionic-angular';
import { LoginPage } from '../login/login';
import { ProductsPage } from '../products/products';
import { LandingPage } from '../landing-page/landing-page';
#Component({
templateUrl: 'tabs.html'
})
export class TabsPage {
tab1Root = HomePage;
tab2Root = ProfilePage;
tab3Root = CartPage;
tab4Root = WishListPage;
tab5Root = ProductSearchPage;
tab6Root = LandingPage;
selectedIndex: Number;
constructor(
public navCtrl: NavController,
public navParams: NavParams,
){
}
ionViewDidLoad() {
this.selectedIndex = this.navParams.get('tabIndex') || 0;
console.log(this.selectedIndex)
}
cartCounterManager(){
return HomePage.cartData.length
}
wishListCounterManager(){
return HomePage.wishListData.length
}
}
I tried every method available but none works. Please help. Every small comments will be appreciated.
Related
I'm trying to make a simple application with ionic (angular) and I have this problem :
I have an HTML table looped with ngFor and I have a condition to verify in the ts file
if this condition is true I want only one line to change his style and give the green background-color
and like a default the background of all the line is red
in my case, if the condition this true all the line of the table "" will be green
here the HTML file
<ion-header>
<ion-toolbar color="medium">
<ion-buttons slot="start">
<ion-back-button defaultHref="folder/Inbox"></ion-back-button>
</ion-buttons>
<ion-title>بطاقة جرد الممتلكات</ion-title>
</ion-toolbar>
</ion-header>
<ion-content>
<ion-button expand="block" (click)="scan()">
<ion-icon name="qr-code-outline"></ion-icon> QR Code scanner
</ion-button>
<ion-button expand="block" color="danger" [disabled]="true">
<ion-icon name="checkmark-circle-outline"></ion-icon> تثبيت الجرد
</ion-button>
<button (click)="check()">clickme</button>
<table class="table">
<tr>
<th>مثبت</th>
<th>تفاصيل المجرد</th>
<th>تعريف المجرد</th>
<th>عدد</th>
<th>المجمد</th>
<th>فرع</th>
<th>الاصل</th>
<th>جديد</th>
</tr>
<tr
*ngFor="let item of jardTable"
[className]="checkedWithQr==true? 'checked':'notchecked'"
>
<td>
<ion-checkbox slot="end" checked="{{item.Installed}}"></ion-checkbox>
</td>
<td></td>
<!-- <td>{{qr}}</td> -->
<td id="width">{{item.productId}}</td>
<td>{{item.quantity}}</td>
<td>{{item.product}}</td>
<td>{{item.branch}}</td>
<td>{{item.origin}}</td>
<td>
<ion-checkbox slot="end" checked="{{item.new}}"></ion-checkbox>
</td>
</tr>
</table>
</ion-content>
here the ts file
import { Component, OnInit } from '#angular/core';
import { BarcodeScanner, BarcodeScannerOptions } from '#ionic-native/barcode-scanner/ngx';
import { AddInvoService } from '../services/serviceAddInvo/add-invo.service';
import { Products } from '../Products';
import {Router} from '#angular/router';
#Component({
selector: 'app-add-invo',
templateUrl: './add-invo.page.html',
styleUrls: ['./add-invo.page.scss'],
})
export class AddInvoPage implements OnInit {
checkedWithQr :boolean;
qrcode: string;
jardTable: Array<Products> = [];
checkelem= {
"id":1,
"new": false,
"origin": "03",
"branch": "2",
"product": "450",
"quantity":"2",
"productId": "03-2-450-2",
"Detail_product": "",
"Installed": false
}
option: BarcodeScannerOptions;
constructor(public barcodeScanner: BarcodeScanner,
private AddInvoService: AddInvoService,
private root:Router) {
}
check() {
for (const iterator of this.jardTable) {
if (iterator.productId == this.checkelem.productId) {
this.checkedWithQr = true;
return this.checkedWithQr;
} else {
this.checkedWithQr = false;
}
}this.root.navigate(['/add-invo']);
}
}
here the CSS file
.notchecked {
background-color: rgb(196, 16, 16) !important;
color: white;
}
.checked {
background-color: green !important;
color: white;
}
You can use ngClass and put your condition accordingly
<div [ngClass]="{'classname' : condition}"></div>
for more please look at this link https://angular.io/api/common/NgClass
I have in this code a method openItem(anuncio, operacao)" that runs when I click on the object that will perform the action. In this case I don't understand why when running (click) = 'checkFavorite (advert) he also performs the action. Clicking the verifyFavorite action should only run it and not openItem. Could anyone help me? thanks !!!
<div class="ali-container">
<div class="ali-linha">
<div class="ali-capa-livro">
<button *ngIf="operacao !== vis" class="ali-capa-livro-btn" (click)="openItem(anuncio, operacao)">
<img src="{{anuncio.publicacao.imagem}}" width="40%" height="40%" />
</button>
<button *ngIf="operacao === vis" class="ali-capa-livro-btn">
<img src="{{anuncio.publicacao.imagem}}" width="40%" height="40%" />
</button>
</div>
<div class="ali-detalhes-livro">
<div class="ali-titulo-livro">{{anuncio.publicacao.titulo}}</div>
<div class="ali-autores-livro linha-unica-elipissis">{{anuncio.publicacao.autores}}</div>
<span class="ali-preco">{{anuncio.preco | currency:'R$':'code'}}</span>
<span class="ali-conservacao">({{anuncio.tipoConservacao}})</span>
<div class="ali-anunciante linha-unica-elipissis">por {{anuncio.usuario.nome}}</div>
<div class="ali-anunciante linha-unica-elipissis">{{anuncio.statusAnuncio}}</div>
<span>Anúncio: {{anuncio.tipoAnuncio.nome}} {{anuncio.tipoAnuncio.valor | currency:'R$':'code' }}</span>
</div>
<div *ngIf="operacao !== vis">
<button mode="ios" class="botao-excluir-anuncio" (click)="excluir(tipo, anuncio._id, favorito)" ion-button
round text-center item-end>
<ion-icon name="trash" item-end></ion-icon>
</button>
</div>
</div>
</div>
<div *ngIf="operacao === vis">
<div *ngIf="!anuncio.favorito">
<button mode="ios" class="botao-naoefavorito-anuncio" (click)='verificarFavorito(anuncio)' ion-button round
text-center item-end>
<ion-icon name="ios-heart-outline" item-end></ion-icon>
</button>
</div>
<div *ngIf="anuncio.favorito">
<button mode="ios" class="botao-favorito-anuncio" (click)='verificarFavorito(anuncio)' ion-button round
text-center item-end>
<ion-icon name="ios-heart" item-end></ion-icon>
</button>
</div>
<div *ngIf="apenasexcluir === 1">
<button mode="ios" class="botao-excluir-anuncio" (click)="excluir(tipo, anuncio._id, favorito)" ion-button round
text-center item-end>
<ion-icon name="trash" item-end></ion-icon>
</button>
</div>
</div>
import { Component, Input, Output, EventEmitter } from '#angular/core';
import { Anuncio } from '../../models/anuncio';
import { AppBasePage } from '../../pages/app-base-page/app-base-page';
import { AnuncioDetalhePage } from '../../pages/anuncio-detalhe/anuncio-detalhe';
import { NavController, NavParams } from 'ionic-angular';
import { AppGlobal } from '../../app/app.global';
import { AppRestService } from '../../services/app-rest.service';
import { RestNovoFavorito } from '../../services/app-rest.service';
#Component({
selector: 'anuncio-list-item',
templateUrl: 'anuncio-list-item.html'
})
export class AnuncioListItemComponent extends AppBasePage {
#Input('anuncio') anuncio: Anuncio;
#Input('tipo') tipo: any;
#Input('favorito') favorito: any;
#Input('cesta') cesta: any;
#Input('operacao') operacao: any;
#Input('apenasexcluir') apenasexcluir: any;
#Output() onExcluir: EventEmitter<any> = new EventEmitter();
#Output() onDetail: EventEmitter<any> = new EventEmitter();
constructor(private rest: AppRestService, private appGlobal: AppGlobal, public navCtrl: NavController, public navParams: NavParams) {
super();
}
openItem(anuncio, operacao, apenasexcluir) {
// quando origem cesta, chama com o parametro para atualizar a cesta de acordo com o anuncio alterado
if (this.cesta) this.navCtrl.push(AnuncioDetalhePage, { anuncio: anuncio, operacao: operacao, apenasexcluir: apenasexcluir, cesta: this.cesta });
else this.navCtrl.push(AnuncioDetalhePage, { anuncio: anuncio, operacao: operacao, apenasexcluir: apenasexcluir});
}
excluir(tipo, id, favorito) {
if (tipo == 1) {
this.onExcluir.emit(favorito);
} else
this.onExcluir.emit(id);
}
verificarFavorito(id) {
if (id.favorito) {
this.excluirFavorito(id.favorito._id)
} else {
this.incluirFavorito(id._id)
}
}
async excluirFavorito(id) {
await this.rest.excluirAnuncioFavorito(id);
}
async incluirFavorito(id) {
let restNovoFavorito = new RestNovoFavorito();
restNovoFavorito.anuncio = id;
await this.rest.incluirFavorito(restNovoFavorito);
}
}
I am using a template I bought recently to build my ionic + angular app. My problem is that I am new to angular and I am trying to redirect the user when the click a button. I've been researching and I got the point where it detects the click but doesn't redirect. I tried importing "router" and other troubleshooting steps but it's not working for me. Here is my html, and ts file.
html
<!--Theme Google Card - Full Image Cards-->
<ion-content padding-top>
<ion-grid no-padding>
<ion-row *ngIf="data != null">
<ion-col col-12 col-md-6 col-lg-6 *ngFor="let item of data.items;let i = index">
<ion-card text-left box-shadow margin-bottom>
<!--Card Image-->
<div card-image>
<img [src]="item.image" />
<div watch-now text-center (click)="onEvent('onItemClick', item, $event)">
<button ion-button button-icon icon-start>
<ion-icon icon-small [name]="item.icon"></ion-icon>
{{item.iconText}}
</button >
</div>
</div>
<!--Card descriptiom-->
<ion-card-content>
<ion-card-title text-center>
<!--Card Subtitle-->
<h1 card-title>{{item.title}}</h1>
<!-- Icon Rating Star -->
<ion-icon *ngFor="let star of item.ratingStar.iconsStars; let i = index" (click)="onStarClass(item.ratingStar.iconsStars, i, $event)">
<i icon-small *ngIf="star.isActive" class="icon {{star.iconActive}}"></i>
<i icon-small *ngIf="!star.isActive" class="icon {{star.iconInactive}}"></i>
</ion-icon>
<!-- Reviews Star -->
<span span-medium>{{item.reviews}}</span>
<!--Card Body Text-->
<p margin-top card-body-text>{{item.description}}</p>
</ion-card-title>
</ion-card-content>
</ion-card>
</ion-col>
</ion-row>
</ion-grid>
</ion-content>
TS
import { Component, Input, ViewChild } from '#angular/core';
import { IonicPage, Content } from 'ionic-angular';
#IonicPage()
#Component({
selector: 'google-card-layout-1',
templateUrl: 'google-card.html'
})
export class GoogleCardLayout1 {
#Input() data: any;
#Input() events: any;
#ViewChild(Content)
content: Content;
slider = {};
constructor() { }
slideHasChanged(slider, index): void {
this.slider[index] = slider;
if (2 == slider._activeIndex) {
if (this.data.items) {
this.data.items.splice(index, 1);
} else {
this.data.splice(index, 1);
}
}
}
onStarClass(items: any, index: number, e: any) {
if (e) {
e.stopPropagation();
}
for (var i = 0; i < items.length; i++) {
items[i].isActive = i <= index;
}
this.onEvent("onRates", index, e);
};
onClickEvent(index): void {
if (this.slider[index]) {
this.slider[index].slidePrev(300);
}
}
onEvent(event: string, item: any, e: any) {
if (e) {
e.stopPropagation();
}
if (this.events[event]) {
this.events[event](item);
}
}
}
Firstly you have to declare your route in your routing file in my case i have one newly created component so i update my route as follow
{
path: 'admin',
canActivate: [AuthGuard],
loadChildren: './pages/admin/admin.module#AdminModule'
},
After that there are two method to navigate,
1) <button [routerLink]="['/admin']" ion-button button-icon icon-start>
2) <button (click)="navigate()" ion-button button-icon icon-start>
and in your ts file add code
navigate() {
this.router.navgateURL(['/admin']);
}
Try:
<button [routerLink]="['/path']" ion-button button-icon icon-start>
I'm using Angular 5, and I wanted to press another button to get another button.
I do not know if I would have to use the ngIf, but I do not know how to identify the previous button.
example.ts
import { Component, OnInit } from '#angular/core';
import { Hero } from '../hero';
import { HeroService } from '../hero.service';
#Component({
selector: 'app-heroes',
templateUrl: './heroes.component.html',
styleUrls: ['./heroes.component.css']
})
export class HeroesComponent implements OnInit {
heroes: Hero[];
constructor(private heroService: HeroService) { }
ngOnInit() {
this.getHeroes();
}
getHeroes(): void {
this.heroService.getHeroes()
.subscribe(heroes => this.heroes = heroes);
}
add(name: string): void {
name = name.trim();
if (!name) { return; }
this.heroService.addHero({ name } as Hero)
.subscribe(hero => {
this.heroes.push(hero);
});
}
delete(hero: Hero): void {
this.heroes = this.heroes.filter(h => h !== hero);
this.heroService.deleteHero(hero).subscribe();
}
}
example.html
<ul class="heroes">
<li *ngFor="let hero of heroes">
<a routerLink="/detail/{{hero.id}}">
<span class="badge">{{hero.id}}</span> {{hero.name}}
</a>
<button class="delete" title="delete hero" (click)="delete(hero)">x</button>
</li>
</ul>
In your component.ts:
#Component({
selector: 'app-heroes',
templateUrl: './heroes.component.html',
styleUrls: ['./heroes.component.css']
})
export class HeroesComponent implements OnInit {
heroes: Hero[];
showSecondButton: boolean = false;
constructor(private heroService: HeroService) { }
ngOnInit() {
this.getHeroes();
}
delete(hero: Hero): void {
this.heroes = this.heroes.filter(h => h !== hero);
this.heroService.deleteHero(hero).subscribe();
this.showSecondButton = true;
}
}
In your html:
<ul class="heroes">
<li *ngFor="let hero of heroes">
<a routerLink="/detail/{{hero.id}}">
<span class="badge">{{hero.id}}</span> {{hero.name}}
</a>
<button class="delete" title="delete hero" (click)="delete(hero)">x</button>
<button *ngIf="showSecondButton"> Your second button</button>
</li>
</ul>
so your best bet is to create two buttons within a div, then have a toggle that switches the button that is displayed.
Example:
<div>
<button *ngIf=!displaysecondbutton (click)='showsecondbutton()'>First Button Yo</button>
<button *ngIf=displaysecondbutton>SecondButtonYo</button>
</div>
typescript file;
displaysecondbutton = false;
showsecondbutton(){
this.displaysecondbutton = true;
}
To keep the code concise I would implement an if statement in your delete function:
public deleteConfirmed = false;
public confirmDelete = false;
delete(hero: Hero): void {
if (deleteConfirmed) {
confirmDelete = deleteConfirmed = false;
this.heroes = this.heroes.filter(h => h !== hero);
this.heroService.deleteHero(hero).subscribe();
}
else{
confirmDelete = true;
}
}
Then in your html:
<button class="delete" title="delete hero" (click)="delete(hero)">Delete</button>
<button *ngIf="confirmDelete" class="delete" title="delete hero" (click)="deleteConfirmed=true; delete(hero)">Confirm Deletion</button>
This way, you are always cycling the same function and just altering some states along the way.
I'm using Bluetooth serial in my Ionic2 app and I want to connect to the device.
Got this now in the .ts file but doesn't works. I can enable bluetooth but cant connect.
import { Component } from '#angular/core';
import { BluetoothSerial } from 'ionic-native';
import { NavController } from 'ionic-angular';
#Component({
selector: 'page-home',
templateUrl: 'home.html'
})
export class HomePage {
public stat_on:any;
public stat_con:any;
public macAddress:"98:D3:31:90:77:36";
constructor(public navCtrl: NavController) {
}
turnON(){
BluetoothSerial.enable().then((status)=> {
this.stat_on=status;
});
}
Connect(){
BluetoothSerial.isEnabled().then((data)=> {
BluetoothSerial.connect("98:D3:31:90:77:36").then((stat_con)=>{
this.stat_con=stat_con;
});
});
}
}
Here is my HTML file
<ion-header>
<ion-navbar>
<ion-title>Home</ion-title>
</ion-navbar>
</ion-header>
<ion-content padding>
<ion-fab right bottom>
<button ion-fab color="light"><ion-icon name="arrow-dropleft"></ion-icon></button>
</ion-fab>
<ion-card-content>
<button ion-button (click)="turnON()">Turn ON Bluetooth</button>
<button ion-button (click)="Connect()">Connect</button>
<p>BT: {{ stat_on }}</p>
<p>Status: {{ stat_connect }}</p>
</ion-card-content>
</ion-content>
Thanks before :)