Quantcast
Channel: Ionic Forum - Latest topics
Viewing all 71531 articles
Browse latest View live

Show content in a tab

$
0
0

@Asgeirr wrote:

Hi i’m new on ionic and i have problem that i would like to know the solution, basically i need take data for a new person to add to an array, the show the info, erase a user or add a new user.
I create the proyect using ionic start name --type=ionic-angular, then i made the user class, next i made a import into the tab one (add user), then import of tab one into tab two and extends (herency), then import of tab two into tab three and extends.
Looks like whe i click the button that calls fuction to add(tab1) o erase users(tab3) works, but y can’t figure it out how to show the info of the users(tab2) i tried with the print on console and ngFor and dosen’t shows nothing.
I thanks any help.

Posts: 1

Participants: 1

Read full topic


Highlight an ion-input in a ion-item using box-shadow on focus - v4

$
0
0

@javasol wrote:

Hi,

I’m trying to highlight input fields when the user focuses on them to highlight the current field. I’ve tried multiple suggestions by modifying the .scss file, it seems like everything in that file is ignored. I do have a workaround using javascript but I don’t like it. Can someone point out a straightforward way to implement this?

Here is what I’m using, this is for ion-textarea but same idea for ion-input. This works but I would rather just modify the .scss of this component instead of using javascript :

    <ion-item id="progressItem">
      <ion-label position="stacked">Progress:</ion-label>
      <ion-textarea rows=3 [(ngModel)]="progress" name="progress" autocomplete="on" spellcheck="true"
        autocorrect="on" disabled={{readonly}} [attr.maxlength]="450" id="progressId"
        (ionFocus)="inputHasFocus('#progressItem', '.item-inner')" (ionBlur)="inputLostFocus('#progressItem', '.item-inner')"></ion-textarea>
    </ion-item>

and then in the .ts file:

 highlightCss = ' border: 1px solid #7bc1f7; '+
  ' box-shadow: 5px 5px 10px 5px #7bc1f7; '+
  ' -moz-box-shadow: 5px 5px 10px 5px #7bc1f7; '+
  ' -webkit-box-shadow: 5px 5px 10px 5px #7bc1f7; padding-left:5px;';

  inputHasFocus(inputId, inputType){
      document.querySelector(inputId).shadowRoot.querySelector(inputType).setAttribute('style', this.highlightCss);
  }
  noLightCss = 'border: none; box-shadow: 0px; -moz-box-shadow: 0px; -webkit-box-shadow: 0px; padding-left:5px;';
  inputLostFocus(inputId, inputType){
    document.querySelector(inputId).shadowRoot.querySelector(inputType).setAttribute('style', this.noLightCss);
  }

Posts: 1

Participants: 1

Read full topic

Get current location without using GPS

$
0
0

@test-nikko wrote:

I am trying to use the native geolocation of ionic, but sadly it cannot get my current location because I am in a closed building. Is there a way to get current location using the internet? Or other solution that does not use the native gps

Posts: 1

Participants: 1

Read full topic

Ipad 9.3.5

$
0
0

@dpark1985 wrote:

I am trying to build app to iPad 9.3.5 but Xcode throws this error

**-[WKWebViewConfiguration setMediaTypesRequiringUserActionForPlayback:]: unrecognized selector sent to instance 0x14d4a1a0**

**2019-03-11 10:43:30.864 MeZooBLE[505:73527] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[WKWebViewConfiguration setMediaTypesRequiringUserActionForPlayback:]: unrecognized selector sent to instance 0x14d4a1a0'**

***** First throw call stack:**

**(0x225cf91b 0x21d6ae17 0x225d52b5 0x225d2ee1 0x224fe238 0x8c56d 0x8cd4f 0x9b421 0x9ab33 0x9afd1 0x98671 0x79bff 0x26b4ad8b 0x26b4a971 0x26b51639 0x26b4eb3d 0x26bc3a5d 0x9cccd 0x799d5 0x26bbf785 0x26de72d1 0x26deb285 0x26dff83d 0x26de87b3 0x23c72c07 0x23c72ab9 0x23c72db9 0x22591dff 0x225919ed 0x2258fd5b 0x224df229 0x224df015 0x26bb8c3d 0x26bb3189 0x798d3 0x22187873)**

Ionic Info
Ionic:

   ionic (Ionic CLI)             : 4.11.0 (/usr/local/lib/node_modules/ionic)
   Ionic Framework               : @ionic/angular 4.1.1
   @angular-devkit/build-angular : 0.13.5
   @angular-devkit/schematics    : 7.2.4
   @angular/cli                  : 7.3.5
   @ionic/angular-toolkit        : 1.4.0

Cordova:

   cordova (Cordova CLI) : 8.0.0
   Cordova Platforms     : ios 4.5.5
   Cordova Plugins       : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 3.1.2, (and 6 other plugins)

System:

   ios-deploy : 2.0.0
   NodeJS     : v10.15.0 (/usr/local/bin/node)
   npm        : 6.7.0
   OS         : macOS Mojave
   Xcode      : Xcode 10.1 Build version 10B61

This app works find in iPhoneX (12.1.4). I think the problem is the app version below 10.
I only added BLE native plugin.

Please help me.

Thank you

Posts: 1

Participants: 1

Read full topic

File or Photo Attachment In Ionic Creator

$
0
0

@sappoutsource wrote:

Hello! Having an issue with Ionic Creator. I’m pulling a mobile version of our website in Ionic Creator. The app is working pretty well, except the file attachment. When I click on “Browse” to attach a file or post photo, it does not open the window to select the file from the phone. Anyone knows a trick to solve this problem?

Thanks!

Posts: 1

Participants: 1

Read full topic

V4-migration-tslint warns about tabs in brand new project

$
0
0

@royappa wrote:

I am migrating my v3 project by using the recommended method of installing v4 (also updated Node & npm), starting a brand new project and then copying items little by little into the new project. When using the tslint, it helpfully shows what to fix in the first old page that I copied. However, it also complains:

WARNING: (…)/src/app/tabs/tabs.page.html:1:2 - Tabs have gone through a significant refactor.
Please see https://github.com/ionic-team/ionic/blob/master/CHANGELOG.md#angular-tabs

But I started this v4 project using “ionic start myApp tabs” so the tabs were created by the CLI, I haven’t touched tab files it created. So is the CLI still generating old tab code? Thanks.

Posts: 1

Participants: 1

Read full topic

Ionic get network location

$
0
0

@test-nikko wrote:

I am trying to build an app that uses gps, but sadly gps does not work well inside the building so I want to have a sort of alternative to get the current location of my user and I think that getting network location would solve my problem. However I don’t how to make it possible.

Posts: 1

Participants: 1

Read full topic

Which all folders need to be committed in the git?


Ionic calendar implement

Promise in app.component constructor is not resolved before loading page

$
0
0

@ejerskov wrote:

Im building an app with Ionic 4. I have a Storage promise in my app.component constructor. It works fine when hard-reloading the app (in the browser), but when the app live reloads on changes, the promise in the constructor is not resolved before the “checklist” page is rendered and then it fails because the user isn’t set yet.

app.component.ts

import { Component } from '@angular/core';
import { Platform} from '@ionic/angular';
import { SplashScreen } from '@ionic-native/splash-screen/ngx';
import { StatusBar } from '@ionic-native/status-bar/ngx';
import { Router } from "@angular/router";
import { Storage } from '@ionic/storage';
import { UserService } from "./services/user.service";

@Component({
  selector: 'app-root',
  templateUrl: 'app.component.html'
})
export class AppComponent {
  constructor(
    private platform: Platform,
    private splashScreen: SplashScreen,
    private statusBar: StatusBar,
    private router: Router,
    private storage: Storage,
    private userService: UserService,
  ) {
    this.storage.get('user').then((user) => {
      if(user) {
        this.userService.user = user;
        this.router.navigateByUrl('checklist');
      } else {
        this.router.navigateByUrl('login');
      }
    });
    this.initializeApp();
  }

  initializeApp() {
    this.platform.ready().then(() => {
      this.statusBar.styleDefault();
      this.splashScreen.hide();
    });

  }
}

checklist.page.ts

import { Component, OnInit } from '@angular/core';
import {UserService} from "../services/user.service";
import {User} from "../models/user";

@Component({
  selector: 'app-checklist',
  templateUrl: './checklist.page.html',
  styleUrls: ['./checklist.page.scss'],
})
export class ChecklistPage implements OnInit {

  user: User;

  constructor(
      private userService: UserService,
  ) {
    this.user = this.userService.user;
  }

  ngOnInit() {
    console.log(this.user);
  }

}

I know that I might can use the Guard-concept, but what if I also need other stuff from Storage before loading a page?

Posts: 1

Participants: 1

Read full topic

Object(...) is not a function - SpinnerDialog

Build error: Plugin with id 'com.android.library' not found

$
0
0

@marcofacchetti wrote:

build failed after run build command

Android Studio project detected
ANDROID_HOME=C:\Program Files (x86)\Android\android-sdk
JAVA_HOME=C:\Program Files (x86)\Java\jdk1.8.0_172
studio
Subproject Path: CordovaLib
Subproject Path: app

FAILURE: Build failed with an exception.

  • Where:
    Build file ‘D:\Source\Studio\iweather\platforms\android\CordovaLib\build.gradle’ line: 40

  • What went wrong:
    A problem occurred evaluating project ‘:CordovaLib’.

Plugin with id ‘com.android.library’ not found.

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

  • Get more help at https://help.gradle.org

BUILD FAILED in 2s
cmd: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.

  • Where:
    Build file ‘D:\Source\Studio\iweather\platforms\android\CordovaLib\build.gradle’ line: 40

  • What went wrong:
    A problem occurred evaluating project ‘:CordovaLib’.

Plugin with id ‘com.android.library’ not found.

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

  • Get more help at https://help.gradle.org

BUILD FAILED in 2s
Picked up _JAVA_OPTIONS: -Xmx512M
[ERROR] An error occurred while running subprocess cordova.

    cordova build android exited with exit code 1.

    Re-running this command with the --verbose flag may provide more information.

I tried to remove and add android platform.
Last week the generation of the APK was correct.

Marco

Posts: 1

Participants: 1

Read full topic

Keep connected ionic 3

Rokuactivationcode

$
0
0

@Lindahelan wrote:

Roku has a lot of popular channels to stream free and paid channels, from the Channel Store, which is one of the largest entertainment libraries available today. First you need to create an account using roku.com/link, and then use the site link to activate the roku account using the code from your TV screen. In case you lose your roku code, you can visit our roku code link site for assistance; our customer support team will be available 24/7 to resolve your issues related to the activation process of your roku device. Call our toll free number +1-844-965-4357

Posts: 1

Participants: 1

Read full topic

MissingDefaultResource

$
0
0

@Tay95 wrote:

Hello,

I’ve a problem with my ionic project.
After executing “ionic cordova build --release” I have:

Cattura2

Without --release all works without problem and the build has success.

Someone could help me with this problem? Thanks.

Posts: 1

Participants: 1

Read full topic


Update array value inside promise ionic 4

$
0
0

@TaGi wrote:

Hello everyone. I want to get API data and set to localStorage(after convert image from the server to base64). When I get data from API, I create a simple loop for update image URL to base64 format but this.users[key].picture["large"] = dataUrl; don’t work. Because of dataUrl value don’t work outside of a function.
How can I update the row object?
What can I do?

this.http.get<User[]>('https://randomuser.me/api?result=100').subscribe(data => {
      this.users = data['results'];

      for (let key in this.users) {
        let value = this.users[key].picture["large"];

        this.toDataURL('//cors-anywhere.herokuapp.com/' + value)
          .then((dataUrl) => {
            this.users[key].picture["large"] = dataUrl;
          });
      }

      this.storage.set('users', "");//clear
      this.storage.set('users', this.users);
      console.log(this.users);
    });

my toDataUrl function:

public toDataURL(url) {
    return fetch(url)
      .then(response => response.blob())
      .then(blob => new Promise((resolve, reject) => {
        const reader = new FileReader();
        reader.onloadend = () => resolve(reader.result);
        reader.onerror = reject;
        reader.readAsDataURL(blob);
      }));
  }

Posts: 1

Participants: 1

Read full topic

Ionic calendar implement help

$
0
0

@ApproTechnologies wrote:

Hi I am New to Ionic. In My Project I want to implement calendar with events I didn’t Know How to Implement Calendar .Please Help Me

Posts: 2

Participants: 2

Read full topic

Custom component inside ion-header

$
0
0

@Corbis wrote:

I created custom header component

...
@Component({
    selector: '[hd-header]',
    templateUrl: 'header.html',
    styleUrls: ['header.scss'],
    changeDetection: ChangeDetectionStrategy.OnPush
})
export class HeaderComponent implements OnInit {
    @Input() type = '';
    @Input() pageName = '';
    @Input() showSearch = false;
    @Input() showNotifications = false;
    @Input() showBag = false;

    @select(bagProductsCountSelector) productsCount: Observable<number>;
    @select(notficationsCountSelector) notificationCount: Observable<number>;
...

and I want to insert it in ion-header without host element.

In ionic v3 this worked
<ion-header hd-header [pageName]="'Sign up'"></ion-header>

In ionic v4 it gives me error:
core.js:15723 ERROR Error: Uncaught (in promise): Error: Template parse errors:
More than one component matched on this element.
Make sure that only one component’s selector can match a given element.
Conflicting components: IonHeader,HeaderComponent ("[ERROR ->]

Anyone can guide me to the right direction?

Posts: 1

Participants: 1

Read full topic

_co.add is not a function.how to solve this?

$
0
0

@Gayu123 wrote:

Register Form

		<div padding>
			<button ion-button color="success" size="large" block (click)="addfn()">Register</button>
		</div>
	</ion-col>
</ion-row>

import { NgModule } from ‘@angular/core’;
import { CommonModule } from ‘@angular/common’;
import { FormsModule } from ‘@angular/forms’;
import { Routes, RouterModule } from ‘@angular/router’;

import { IonicModule } from ‘@ionic/angular’;

import { RegisterPage } from ‘./register.page’;

const routes: Routes = [
{
path: ‘’,
component: RegisterPage
}
];

@NgModule({
imports: [
CommonModule,
FormsModule,
IonicModule,
RouterModule.forChild(routes)
],
declarations: [RegisterPage]
})
export class RegisterPageModule {
user_name: string ="";

constructor(public  navCtrl: IonicModule)
{
	
}
addfn():void
{
console.log(this.user_name);
}

}

Posts: 1

Participants: 1

Read full topic

Get the item thats selected

$
0
0

@lstables wrote:

Hi all,

I have the following code in the html file:

<button ion-item  *ngFor="let item of properties" (click)="itemSelected(item)">
        {{ item.name_number }}, {{ item.street }}, {{ item.town }}, {{ item.postcode }}</button>

This basically shows a list of properties, now I want to be able to click a property and the data from the itemSelected() be shown in a different div element.

How does one achieve this? PS a Ionic newbie here.

Posts: 1

Participants: 1

Read full topic

Viewing all 71531 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>