Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all 49308 articles
Browse latest View live

Create Dynamic Plugin elements on page

$
0
0

@TrevorNWatson wrote:

Hello,

We have been tasked with creating a plugin system for one of the apps we are working on written using @ionic/angular 4.2.0 .

As part of the UI, we need to inject web components written by the plugin developers. I’ve managed so far, to create a dynamic JavaScript loader that allows us to, per component, dynamically load the javascript files that contain the plugins.

This allows me to use the custom element tags directly in our templates e.g.
<fancy-button [(productId)]=“1”>

We’d like to create the elements dynamically on the page if possible (have a tag that is an “injection point”)

However, I can’t figure out how to create the components and bind the data to them.

I was attempting to use ViewChild to append elements, but this wasn’t working,

My second attempt was to use getElementById and use the innerHTML on a div, but this didn’t work either.

  const ComponentList = ['fancy-counter'];
  const container: HTMLElement = document.getElementById('sales-channel-entry-point');
  const elementString: string[] = [];
  for (let i = 0; i < ComponentList.length; i++) {
    elementString.push(`<${ComponentList[i]}></${ComponentList[i]}>`);
  }
  this.innerHtmlVar = elementString.join();
  console.log(this.innerHtmlVar);


<div [innerHTML]="innerHtmlVar"></div> 

Is this possible in the ionic framework?

Thanks in advance,

Trevor

Posts: 1

Participants: 1

Read full topic


Alerts / Push? from background mode timer (local app)

$
0
0

@wekas wrote:

I have not really done much with background mode before and I have not used push notifications before.

What am trying to achieve is to give the user a warning they are going to be auto logged out 5 minutes before it happens and give them a chance to refresh their token.

It works fine when the app is active in the foreground. I pop up an alert and get them to click “ok” otherwise after 5 mins it logs out.

I have added @ionic-native/background-mode to my project and enabled background mode but I am not sure how to get the app to alert the user.

Is there a way to do this?
Could I use a push notification locally from the app to notify the user rather than an alert?

Posts: 1

Participants: 1

Read full topic

How to change ion-toolbar background dynamically - Ionic v4

$
0
0

@mathm3 wrote:

Hello!

I’m trying to change ion-toolbar color dynamically (I get the hexadecimal color from database), but not working.

I tried:

<ion-toolbar [style.background-color]="customColor"></ion-toolbar>
<ion-toolbar [color]="customColor"></ion-toolbar>

The [style.background-color] work with others components. How i change the toolbar color dynamically?
Thank you!

Posts: 2

Participants: 2

Read full topic

Embed website

$
0
0

@Bonsaiko wrote:

Hello,

First of all I’m not sure if I should use Ionic V3 ou V4 for my new project.
Could you please advice me ?

The project would be an app that is almost the same as the existing website.
The only thing is that the app will have some features that the website doesn’t have.
I have a few questions about how to do it :

  • I was thinking about embedding the website inside the app. but how will it work exactly ? I mean, my idea was to add new “pages” to the site, but these pages only must appear inside the app. So I was wondering how I could do this…

  • Or maybe in this case embedding the website is not a good idea ? I could then use the website API and recreate real screens for the app ?

I will be waiting for your advice about the best way to do it, and the best ionic version also.
Thanks a lot.

Posts: 1

Participants: 1

Read full topic

Chrome / chromium dev tools hangs when trying to profile Ionic apps

$
0
0

@doron wrote:

I noticed that when trying to use the dev-tools profiler built into Chrome / Chromium, it hangs at the very beginning. I start it after the app has fully been loaded and the page is showing and operational, not on page reload. It just hangs forever reporting “Loading profile…”. Perhaps I did not wait long enough but I waited on the order of half an hour - it should not take that long. This issue does not seem to be related to my specific app. I tried it with the standard app created via ionic start --type=angular (sidemenu) - which replicates the issue. Dev-tools’s profiler still hangs in “Loading profile…” at the very beginning of trying to benchmark even those lightweight starter apps. This may be an angular issue, not Ionic related. I could not find anything useful to solve this issue after some searching… Any help would be greatly appreciated if anybody has solved this. Thanks!

Posts: 1

Participants: 1

Read full topic

Audio Streaming stop later than x minutes screen block

$
0
0

@ericciaparicio wrote:

Hello. I have an iframe to audio streaming. Its works but the audio stop later than x minutes screen block.

Any help?
Regards

ER

Posts: 1

Participants: 1

Read full topic

Dyn. number of RadioButtons

$
0
0

@MrChance wrote:

I have a list of 10 questions . Every question has 6 options. I can click an option and go to the next question. All options are unchecked if it is a new question. When i go back the selected option is checked. All is fine. But if i change the number of options from question to question, it’s not working correct: the selected option is unchecked or at a new question not all options are unchecked.

Question.ts :
export class Question {
    id : number;
    qtext : string; 
    options : string[];
    selected : number;
}
import { Question } from './Question';

export const QUESTIONS: Question[] = [
    { id: 0, qtext: 'Question 1', options: ['A1', 'A2', 'A3', 'A4', 'A5', 'A6'], selected: -1 },
    { id: 1, qtext: 'Question 2', options: ['A1', 'A2', 'A3', 'A4', 'A5', 'A6'], selected: -1 },
    { id: 2, qtext: 'Question 3', options: ['A1', 'A2', 'A3', 'A4', 'A5', 'A6'], selected: -1 },
    { id: 3, qtext: 'Question 4', options: ['A1', 'A2', 'A3', 'A4', 'A5', 'A6'], selected: -1 },
    { id: 4, qtext: 'Question 5', options: ['A1', 'A2', 'A3', 'A4', 'A5', 'A6'], selected: -1 },
    { id: 5, qtext: 'Question 6', options: ['A1', 'A2', 'A3', 'A4', 'A5', 'A6'], selected: -1 },
    { id: 6, qtext: 'Question 7', options: ['A1', 'A2', 'A3', 'A4', 'A5', 'A6'], selected: -1 },
    { id: 7, qtext: 'Question 8', options: ['A1', 'A2', 'A3', 'A4', 'A5', 'A6'], selected: -1 },
    { id: 8, qtext: 'Question 9', options: ['A1', 'A2', 'A3', 'A4', 'A5', 'A6'], selected: -1 },
    { id: 9, qtext: 'Question 10', options: ['A1', 'A2', 'A3', 'A4', 'A5', 'A6'], selected: -1 },
]

Posts: 1

Participants: 1

Read full topic

Ionic Page laggs on first Launch on iPhone first time

$
0
0

@faske wrote:

I have a blanc ionic 4 project.
My ionic versions are:

Ionic:

ionic (Ionic CLI) : 4.12.0 (/usr/local/lib/node_modules/ionic)
Ionic Framework : @ionic/angular 4.3.1
@angular-devkit/build-angular : 0.13.8
@angular-devkit/schematics : 7.3.8
@angular/cli : 7.3.8
@ionic/angular-toolkit : 1.5.1

Capacitor:

capacitor (Capacitor CLI) : 1.0.0-beta.19
@capacitor/core : 1.0.0-beta.19

System:

NodeJS : v11.2.0 (/usr/local/bin/node)
npm : 6.9.0
OS : macOS Mojave

With Capacitor i deploy the app on my iPhone. It works normal.

Now i add in the Page an ion-refresher like


<ion-content>
  <ion-refresher>
    <ion-refresher-content
            pullingIcon="arrow-dropdown"
            pullingText="Pull to refresh"
            refreshingSpinner="circles"
            refreshingText="Refreshing...">
    </ion-refresher-content>
  </ion-refresher>

  <ion-list>
    <ion-item *ngFor="let item of items">
      <ion-icon [name]="item.icon" slot="start"></ion-icon>
      {{item.title}}
      <div class="item-note" slot="end">
        {{item.note}}
      </div>
    </ion-item>
  </ion-list>
</ion-content>

Now the Page laggs on the first launch on my iPhone. Android and Browser it is okay.

Whats my mistake?

Posts: 1

Participants: 1

Read full topic


Ionic Build on Mac: Illegal Configuration

Readonly not working for ion-item

Ionic3 - ionic toggle button is always hidden!

$
0
0

@pdj wrote:

on HomePage which is root page, it’s working well
but on secondPage , it’s not working.
always hidden and display is none.
I forced it to not to none. and it appeared well but it’s not working at all( click menu icon, but not responding opening side menu page)

I added persistent to ion-menu but not working as well
should I have same value to root page’s ion-menu?

<ion-menu persistent = “true” style=" z-index: 9999999999 !important;"class=“ionmenu” [content]=“content” type=‘reveal’ side=“left”>

Posts: 1

Participants: 1

Read full topic

(ionic 4)I want to know How to build ionic4 to apk

How can I use a bio-metric or iris device in ionic application to get user information and process that information for the user identification.

$
0
0

@pranav9k wrote:

I am a novice in ionic world. I am developing a mobile application for a bank. One of the features of this app is to take the fingerprint or the iris data from the hardware and make an API call to validate user verification.

What will be the best approach to achieve with all security measures?

Posts: 1

Participants: 1

Read full topic

How to activate alternative button

App: Change automatically language

$
0
0

@Manu333 wrote:

I was wondering that maybe IONIC has any language selector or automatic translator or any helper to translate my app from Spain to English or vice versa, and how can it be done, letting user choose language or even (like android studio translator tool) use language device to translate my app? Thanks

Posts: 1

Participants: 1

Read full topic


Tag name of Ionic/React components without dash

$
0
0

@rolfg wrote:

I have a question of understanding. Ionic’s React web components do not have tag names with a dash. But according to the definition of the web components this should be the case. Why?
Can I still use a Stencil-created web component and tag name with dash in React?

Posts: 1

Participants: 1

Read full topic

Ionic4 currency mask reactive forms

$
0
0

@Chuckbollocks wrote:

I am looking for a live currency mask for Ionic4 type=angular to be implemented in a reactive form(s) i.e. as you type it automatically formats by adding the thousand separator.

I have used “angular2-text-mask”: “8.0.1” with “text-mask-addons”: “3.5.1” with success but it uses ngModel and template forms. Any solution for reactive forms or suggestions would be appreciated.

Posts: 1

Participants: 1

Read full topic

Stretchy Header

$
0
0

@Nazirovich wrote:

Hi,
I’m using Ionic 4 and I want to make the header image to stretch while pulling down like the following:

can anyone help me with this?

Thanks.

Posts: 1

Participants: 1

Read full topic

Click action is not working in ion-slide

$
0
0

@vandanareddy wrote:

Implemented ion-slides dynamically with autoplay:

  1. if we enable autopaly click actions are not working inside the first slide if there are buttons to click,
  2. But Click event is working fine without autoplay for the same first-slide.

Thanks in advance.

Posts: 2

Participants: 2

Read full topic

Ionic 4 Transforming base64Image to url and showing it

$
0
0

@SanduCuragau wrote:

Cheers
All this is local since its all tests for now, in the future I’ll keep the things on cloud.

What I’m trying to do right now is:

  • have user’s image being displayed on the menu
  • when he clicks it he can choose an image from his gallery
  • set that image as his profile picture
    I do all this by using the Camera and CameraOptions, but when I do this I get a base64image which is like 300kb each, which I keep on the database as the user’s image reference, but that’s insanely big to be a reference, specially since there’ll be many users, so I need that reference to be wayyyyy smaller, I found a way to do so

just in case its needed, this is how I get the image and set it as his profile picture, works fine
image
but as u can see at the end I send the image to yet another method I have, well I wanted that method to create a smaller link for the image and then there set it as a profile picture instead with that smaller link, but since it’s not working, for now I’m setting the avatar with the base64 reference

Here is the method that’s supposed to convert it

And appearently it really does, the dataUrl really ends up being exactly what I’d hope for

BUT, thing is, I’ve tried it all but I can’t show it on an ion-img for anything

Posts: 1

Participants: 1

Read full topic

Viewing all 49308 articles
Browse latest View live