ionic2

Angular2,Typescript: How to put the radio button checked when in an array which displays one element per page?

纵然是瞬间 提交于 2020-01-28 02:55:28
问题 Let me explain it in detail.Sorry for the question framing. I've an array of Objects which is stored in the REST API. That array contains questions and choices. Each question has 4 choices which are radio buttons. I'm trying to display one question at a time on the same page along with the choices of the question. I've 2 buttons "previous" and "forward" which load the question on the same page. When I click the next button the next question in the array along with the choices are displayed

Center span element under an image element (Ionic2)

一个人想着一个人 提交于 2020-01-24 20:04:33
问题 How to centralize this span under the avatar using flex? The avatar image is well centralized if I remove the span, but when I insert the span, even with display:block it displays on the right side. Here is my HTML : <ion-navbar *navbar> <ion-avatar item-center> <img src="img/bill-gates-avatar.jpg"> <span>Bill Gates</span> </ion-avatar> </ion-navbar> <ion-content padding> Content here... </ion-content> That is my SCSS : .tabs { ion-navbar-section { min-height: 16.6rem; } .toolbar { min-height

Uncaught TypeError: Cannot read property 'element' of undefined when press login button

試著忘記壹切 提交于 2020-01-24 19:29:06
问题 I get this error Uncaught TypeError: Cannot read property 'element' of undefined when I press on login button in my ionic2 and angular2 app. I tried to look on variable that not intialize or function but I didn't find at all. that's the login function import { Component } from '@angular/core'; import { NavController,ViewController } from 'ionic-angular'; import { Storage} from '@ionic/storage'; //components import { MyService } from '../../providers/my-service'; import { AdminPage } from '..

ionic2 android build error

て烟熏妆下的殇ゞ 提交于 2020-01-24 13:07:25
问题 When I try to run ionic 2 application ionic run android It stops leaving an error as below. Please help me to fix this problem FAILURE: Could not determine which tasks to execute. * What went wrong: Task 'wrapper' not found in root project 'android'. * Try: Run gradle tasks to get a list of available tasks. BUILD FAILED Total time: 1.435 secs Error: /usr/share/gradle/bin/gradle: Command failed with exit code 1 My ionic info is Cordova CLI: 7.0.0 Ionic Framework Version: 3.1.1 Ionic CLI

ionic2 how to remove white space from status bar from top in iphone

佐手、 提交于 2020-01-24 01:27:12
问题 I am working on ionic 2 and here is my local set up as- ****************************************************** Your system information: Cordova CLI: 6.4.0 Ionic CLI Version: 2.1.8 Ionic App Lib Version: 2.1.4 ios-deploy version: Not installed ios-sim version: 5.0.8 OS: OS X Yosemite Node Version: v6.2.2 Xcode version: Xcode 7.2 Build version 7C68 ****************************************************** I wanted to remove white space from top in iphone, How I can? 回答1: I am glad to say that I

ionic using get previous page name

半世苍凉 提交于 2020-01-23 05:57:55
问题 I am using ionic 2. I need get previous page name. here is my code. @ViewChild(Nav) nav:Nav constructor() { this.nav_app.viewDidEnter.subscribe( view => console.log("Current opened view is : " + view.name); ) } still i am getting Current opened view is : t How can i get previous page name. Kindly advice me, Thanks 回答1: You can try import { Component, ViewChild } from '@angular/core'; import { NavController } from 'ionic-angular'; export class MyApp { constructor(public navCtrl:NavController){

How to get audio files on my phone using Ionic 2 Cordova plugins?

谁说胖子不能爱 提交于 2020-01-22 02:13:43
问题 I have tried the Ionic mediaPlugin import { MediaPlugin } from 'ionic-native'; var file = new MediaPlugin('path/to/file.mp3'); I'm still confused on how to do that. All I want to do is to create something like a media player, that gets all the audio on a users android phone, and to play and pause it too. 回答1: Check this tutorial first it will guide you. However check this too, it will tell you where you have to store your data. If you do it on android, you should use externalDataDirectory .

Is it possible to inject a service inside another service and vice versa at the same time?

China☆狼群 提交于 2020-01-21 11:18:13
问题 I have a real scenario in a real project where I need 2 services to access the properties and/or methods of each other. I'm not an Angular expert so is it possible? I have tried and it fails. Here's my attempt: app.component.ts import { Component } from '@angular/core'; import { FirstService } from './first.service'; import { SecondService } from './second.service'; @Component({ selector: 'my-app', template: '<h1>Hello world!</h1>', providers: [FirstService, SecondService] }) export class

Is it possible to inject a service inside another service and vice versa at the same time?

自闭症网瘾萝莉.ら 提交于 2020-01-21 11:18:11
问题 I have a real scenario in a real project where I need 2 services to access the properties and/or methods of each other. I'm not an Angular expert so is it possible? I have tried and it fails. Here's my attempt: app.component.ts import { Component } from '@angular/core'; import { FirstService } from './first.service'; import { SecondService } from './second.service'; @Component({ selector: 'my-app', template: '<h1>Hello world!</h1>', providers: [FirstService, SecondService] }) export class

Ionic 2: Generated back button click event

偶尔善良 提交于 2020-01-20 18:30:54
问题 I'm trying to log the user's action of clicking the generated back button in the navigation bar, but I can't find a way to handle the click event? It seems like the ion-nav-back-button from here isn't working anymore? 回答1: According to the official Ionic docs, you can override the backButtonClick() method of the NavBar component: import { ViewChild } from '@angular/core'; import { Navbar } from 'ionic-angular'; @Component({ selector: 'my-page', template: ` <ion-header> <ion-navbar> <ion-title