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

How to make my custom component support the property [disabled] on button?

$
0
0

@fagworio wrote:

I have a custom component agenda-footer and inside has 2 buttons.
I want to add support the property [disabled] to the buttons, but I dont know how to implement this?

I want to inheritance the property [disabled] , but no Ideia how to do this

agenda-footer.ts

import { Component, Input, Output, Renderer, EventEmitter } from '@angular/core';
import { Keyboard } from 'ionic-angular';

@Component({
  selector: 'agenda-footer',
  templateUrl: 'agenda-footer.html'
})
export class AgendaFooterComponent  {

  @Input('leftActionLabel') leftActionLabel: string;
  @Input('rightActionLabel') rightActionLabel: string;
  @Output() leftActionClick: any = new EventEmitter();
  @Output() rightActionClick: any = new EventEmitter();

  constructor( private keyboard: Keyboard, public renderer: Renderer) {
    this.leftActionLabel = 'Cancelar';
    this.rightActionLabel = 'Avançar';
  }

  leftAction() {
    this.leftActionClick.emit({value:this.leftActionLabel});
  }

  rightAction() {
    this.rightActionClick.emit({value:this.rightActionLabel});
  }
 }

agenda-footer.html

<div class="footer-box" [hidden]="keyboard.isOpen()">
  <div class="footer-actions">
      <div class="btn-left">
        <button ion-button color="danger" round tappable (click)="leftAction()">{{ leftActionLabel }}</button>
      </div>
      <div class="btn-right">
        <button ion-button color="primary-btn" round tappable (click)="rightAction()">{{ rightActionLabel }}</button>
      </div>
    </div>
</div>

Calling my custom component

<agenda-footer 
  [leftActionLabel]="'Cancelar'" 
  [rightActionLabel]="'Avançar'" 
  (leftActionClick)="inicioRegistro()"
  (rightActionClick)="estabelecimento()">
</agenda-footer>

And I want to call my component like this

<agenda-footer 
  [leftActionLabel]="'Cancelar'" 
  [leftActionDisabled]="userData.email == '' "
  [lrightActionDisabled]="userData.email == '' "
  [rightActionLabel]="'Avançar'" 
  (leftActionClick)="inicioRegistro()"
  (rightActionClick)="estabelecimento()">
</agenda-footer>

If someone knows, I will be very happy with some direction.

Posts: 2

Participants: 2

Read full topic


Application is crashing on latest iOS devices like XR, XR Max

$
0
0

@ckumar13 wrote:

>PLATFORM AND VERSION
>iOS
>Incident Identifier: 0167F154-1A77-4454-A0A2-22846677DEF4
>CrashReporter Key: ab540aded1d4379ba5a07697901640f55c00aa4a
>Hardware Model: iPhone11,8.
>Process: MilitaryStar [2251]
>Path: /private/var/containers/Bundle/Application/0574F9A2-9811-48F5-8E5C-88D88EB19D55/MilitaryStar.app/MilitaryStar
>Identifier: com.aafes.militarystar
>Version: 1.5.3 (1.5.3)
>AppStoreTools: 10B61
>AppVariant: 1:iPhone11,8:12
>Code Type: ARM-64 (Native)
>Role: Non UI
>Parent Process: launchd [1]
>Coalition: com.aafes.militarystar [758]
>
>
>Date/Time: 2018-12-09 14:18:42.5151 +0100
>Launch Time: 2018-12-09 14:18:36.2489 +0100
>OS Version: iPhone OS 12.1 (16B93)
>Baseband Version: 1.01.30
>Report Version: 104
>
>DESCRIPTION OF PROBLEM
>After loading login page the app is crashing on iPhone XR & XR Max. Application is developed using IONIC framework & on login page we have implemented touchid to log in to the application.
>Crash Log is mentioned below:
>---------------
>Exception Type: EXC_BAD_ACCESS (SIGSEGV)
>Exception Subtype: KERN_INVALID_ADDRESS at 0x0000000000000010
>VM Region Info: 0x10 is not in any region. Bytes before following region: 4331913200
> REGION TYPE START - END [ VSIZE] PRT/MAX SHRMOD REGION DETAIL
> UNUSED SPACE AT START
>—>
> __TEXT 000000010233c000-0000000102340000 [ 16K] r-x/r-x SM=COW …/MilitaryStar
>
>Termination Signal: Segmentation fault: 11
>Termination Reason: Namespace SIGNAL, Code 0xb
>Terminating Process: exc handler [2251]
>Triggered by Thread: 0
>
>Thread 0 Crashed:
>0 UIKitCore 0x00000001c34c170c -[UIPresentationController _transitionToPresentationController:withTransitionCoordinator:] + 1912 (UIPresentationController.m:495)
>1 UIKitCore 0x00000001c35aeffc -[UIViewController _adaptedPresentationControllerForTraitCollection:withTransitionCoordinator:] + 824 (UIViewController.m:6999)
>2 UIKitCore 0x00000001c34c83e0 -[UIPresentationController _sharedParent:willTransitionToTraitCollection:withTransitionCoordinator:] + 216 (UIPresentationController.m:1694)
>3 UIKitCore 0x00000001c34c8268 -[UIPresentationController _window:willTransitionToTraitCollection:withTransitionCoordinator:] + 100 (UIPresentationController.m:1679)
>4 UIKitCore 0x00000001c34c82cc -[UIPresentationController _window:willTransitionToTraitCollection:withTransitionCoordinator:] + 200 (UIPresentationController.m:1681)
>5 UIKitCore 0x00000001c359b7cc -[UIViewController _window:willTransitionToTraitCollection:withTransitionCoordinator:] + 360 (UIViewController.m:2671)
>6 UIKitCore 0x00000001c3bd858c -[UIWindow _willTransitionToTraitCollection:withTransitionCoordinator:] + 456 (UIWindow.m:4929)
>7 UIKitCore 0x00000001c3bd811c -[UIWindow _willChangeToSize:orientation:screen:withTransitionCoordinator:] + 200 (UIWindow.m:4860)
>8 UIKitCore 0x00000001c3bcf7c8 -[UIWindow _rotateToBounds:withAnimator:transitionContext:] + 268 (UIWindow.m:3130)
>9 UIKitCore 0x00000001c3bd22d4 -[UIWindow _rotateWindowToOrientation:updateStatusBar:duration:skipCallbacks:] + 1220 (UIWindow.m:3763)
>10 UIKitCore 0x00000001c3bd2b34 -[UIWindow _setRotatableClient:toOrientation:updateStatusBar:duration:force:isRotating:] + 520 (UIWindow.m:3806)
>11 UIKitCore 0x00000001c3bd1d5c -[UIWindow _setRotatableViewOrientation:updateStatusBar:duration:force:] + 132 (UIWindow.m:3637)
>12 UIKitCore 0x00000001c34cb398 -[_UIFullscreenPresentationController _placeCounterRotationViewWithView:inWindow:fromOrientation:toOrientation:force:] + 520 (_UIFullscreenPresentationController.m:156)
>13 UIKitCore 0x00000001c34cb034 -[_UIFullscreenPresentationController _adjustOrientationIfNecessaryInWindow:forViewController:preservingViewController:] + 940 (_UIFullscreenPresentationController.m:138)
>14 UIKitCore 0x00000001c34c0a10 -[UIPresentationController _presentWithAnimationController:interactionController:target:didEndSelector:] + 968 (UIPresentationController.m:411)
>15 UIKitCore 0x00000001c35ae998 -[UIViewController _presentViewController:modalSourceViewController:presentationController:animationController:interactionController:completion:] + 1524 (UIViewController.m:6912)
>16 UIKitCore 0x00000001c35b04c0 -[UIViewController _presentViewController:withAnimationController:completion:] + 4320 (UIViewController.m:7261)
>17 UIKitCore 0x00000001c35b2e20 __63-[UIViewController _presentViewController:animated:completion:]_block_invoke + 108 (UIViewController.m:7644)
>19 UIKitCore 0x00000001c35b2d74 -[UIViewController _presentViewController:animated:completion:] + 192 (UIViewController.m:7650)
>20 UIKitCore 0x00000001c35b30f8 -[UIViewController presentViewController:animated:completion:] + 176 (UIViewController.m:7682)
>21 SafariServices 0x00000001abbcbbf8 __82-[_SFAppAutoFillPasswordViewController authenticateToPresentInPopover:completion:]_block_invoke + 240 (SFAppAutoFillPasswordViewController.m:82)
>22 CoreFoundation 0x0000000195ffe8b4 invoking
+ 148
>23 CoreFoundation 0x0000000195ed7538 -[NSInvocation invoke] + 308 (NSForwarding.m:3052)
>
>
**>STEPS TO REPRODUCE **
**>- Launch the application. **
**>- After splash screen, login page will appear. **
>- Application crashing on devices specified above.

Posts: 1

Participants: 1

Read full topic

how to connect an ionic application to MongoDb

$
0
0

@yassoua wrote:

I developed an Ionic application and would like to know how I can transfer the data from my forms to the Mongodb No-SQL database.I would like to use NestJs but frankly I do not know how to do it and I can not find appropriate tutorials.Need help please.Thank you.

Posts: 1

Participants: 1

Read full topic

Hide content depending on the platform

IONIC 3 - IOS Keyboard Overlap while switching to emoji keyboard

$
0
0

@safrul85 wrote:

Hi, as per title state, it seems like IONIC 3 Keyboard is not working fine on IOS. The keyboard is overlapping if switching to Emoji keyboard.

Like previous version of IONIC 1, there have directive ‘keyboard-attach’. But starting IONIC 2, the directive is gone already and this keyboard issue came.

Anyone have solution for this? Below is my HTML code:

<ion-footer style="background-color: #f1f1f1; padding-bottom: 0px;">
       <ion-toolbar>
          <ion-row class="message_row">
             <ion-col col-10>
                <ion-item no-lines>
                   <input type="text" placeholder="Don't be shy, say something..." class="chatInput">
                </ion-item>
             </ion-col>
             <ion-col col-2>
                <button color="primary" (click)="sendMessage()" ion-button icon-only clear>
                   <ion-icon color="tom" name="md-send"></ion-icon>
                </button>
             </ion-col>
          </ion-row>
       </ion-toolbar>
    </ion-footer>

SCSS code as below:

.chatInput {
    	width: 100%;
    	padding: 3px;
    	margin-left: auto;
    	margin-right: auto;
    	background-color: #fff;
    	border:0px;
    	font-size: 14px;
    }

And here is the screen shot:

Thanks

Posts: 1

Participants: 1

Read full topic

Ionic 4/ Angular 6 - getting data outside lifecycle hook inside app.component

$
0
0

@impuls3 wrote:

I have my navigation set up in my app.component.html , and I would like to use an *ngIf inside that template. However, since lifecycle hooks like ionViewWillEnter , etc don’t work in app.component.ts , how can I trigger a call to fire every time the side nav is popped open?

I am just trying to get a red dot to show if there are notifications in my array

app.component.html

    ...
    <ion-list>
      <ion-menu-toggle auto-hide="false" *ngFor="let p of appPages">
        <ion-item [routerDirection]="'root'" [routerLink]="[p.url]">
          <ion-icon slot="start" [name]="p.icon"></ion-icon>
          =====>HERE===><div class="red-dot" *ngIf="p.title == 'Home' && notifications.length > 0"></div> 
          <ion-label>
            {{p.title}}
          </ion-label>
        </ion-item>
      </ion-menu-toggle>
    </ion-list>
  </ion-content>
</ion-menu>
<ion-router-outlet main></ion-router-outlet>
...

app.component.ts

...

initializeApp() {
const parseQueryString = (queryString) => {
  const query = <any>{};
  for (let param of queryString.split('&')) {
    const pair = param.split('=');
    query[pair[0]] = pair[1];
  }
  return query;
};

this.platform.ready().then(() => {
  this.statusBar.styleDefault();
  this.splashScreen.hide();
  this.deepLinks.route({
  ...

What I want to add to the side nav logic

const newData = await this.api.listModel('Notification', {
  page: this.page
});
this.notifications = this.notifications.concat(newData);
this.notifications = _.filter(this.notifications, { isActioned: false }

Posts: 1

Participants: 1

Read full topic

Ionic 4 Android app build and zipalign

$
0
0

@rbender wrote:

We’re using @ionic/angular v4.0.0-rc.0 and @ionic-native/core: 5.0.0-beta.22. We’re building our Android app as such:

ionic cordova build android --prod --device --release --buildConfig build.json

The build.json file has our keystore/signing information as described Android - Signing an App documentation.

I noticed in the Android publishing guide that another step that should be taken is to use the zipalign tool, but I don’t see any way to have this step be automatically completed as part of Ionic or Cordova build process.

My question: is zipalign automatically completed as part of Ionic/Cordova build process? If not, is there an easy way to integrate this into an automated build process? Ideally, it would be configuration that could be provided to the build command (if it’s not already part of build process).

Thanks!

Posts: 1

Participants: 1

Read full topic

How to reduce all components size in platform browser?

$
0
0

@guidosl wrote:

How can I reduce the size of all the components?

since on the browser platform you see everything very big

Thanks

Posts: 1

Participants: 1

Read full topic


Firebase phone authentication iOS no verificationID

$
0
0

@obinnae wrote:

Hello,
I’m implementing Firebase’s phone authentication. It works fine on an Android device, but on an iPhone, the verifyPhoneNumber() function returns credentials but no verification ID. Thus,

window.FirebasePlugin.verifyPhoneNumber(tell, 60, function (credential) {
console.log(credential.verificationId);
})

returns blank/undefined. Like I said, on Android, it does return the ID.
Any idea why? I need the verificationId to proceed. Please help me out!

Thanks!

Posts: 1

Participants: 1

Read full topic

XMLHttpRequest cannot load on iOS 12

$
0
0

@DipakJain wrote:

Hi All,

I am trying to call Restful API on iPhone simulator with .net backend.
I am getting the below error:

The certificate for this server is invalid. You might be connecting to a server that is pretending to be “example.com” which could put your confidential information at risk.
[Error] XMLHttpRequest cannot load https://example.com/api/auth due to access control checks.
Ionic:

   ionic (Ionic CLI)  : 4.2.1 (/usr/local/lib/node_modules/ionic)
   Ionic Framework    : ionic-angular 3.9.2
   @ionic/app-scripts : 3.2.1

Cordova:

   cordova (Cordova CLI) : 8.0.0
   Cordova Platforms     : android 7.0.0, ios 4.5.5
   Cordova Plugins       : cordova-plugin-ionic-webview 2.3.1, (and 10 other plugins)

System:

   ios-deploy : 1.9.2
   NodeJS     : v8.11.4 (/usr/local/bin/node)
   npm        : 6.4.1
   OS         : macOS
   Xcode      : Xcode 10.1 Build version 10B61
cordova plugin ls
cordova-fabric-plugin 1.1.14-dev "cordova-fabric-plugin"
cordova-plugin-app-version 0.1.9 "AppVersion"
cordova-plugin-device 1.1.7 "Device"
cordova-plugin-firebase 2.0.5 "Google Firebase Plugin"
cordova-plugin-ionic-webview 2.3.1 "cordova-plugin-ionic-webview"
cordova-plugin-network-information 2.0.1 "Network Information"
cordova-plugin-splashscreen 4.1.0 "Splashscreen"
cordova-plugin-whitelist 1.3.3 "Whitelist"
cordova-plugin-x-toast 2.7.2 "Toast"
cordova-sqlite-storage 2.5.2 "Cordova sqlite storage plugin"
ionic-plugin-keyboard 2.2.1 "Keyboard"

My iPhone simulator configuration:

Also, I tried with native HTTP plugins, same error getting.

$ ionic cordova plugin add cordova-plugin-advanced-http
$ npm install --save @ionic-native/http

Xcode Version 10.1 (10B61).

Please help me to resolve this issue.

Thanks in advance.

Posts: 1

Participants: 1

Read full topic

How to dynamically add function input in html?

$
0
0

@thehuangkai wrote:

Hi guys,

I am making an ionic3 app and I am trying to add a function “nextPage(someData)” to my html.

In my html (pardon the html, seems like I cant show it properly here):

div *ngFor=“let item of items”
<ion-card (click)=“nextPage(someData)”>

In my ts:

nextPage(inputData: string): void{
this.data = inputData;
this.navCtrl.push(“nextPage”,{data:this.data});
}

As you can see I am adding nextPage(someData) function to my ion-card component and the someData will come from the items array that I have. Hence each ion-card component will have different data for its nextPage(someData). What I am trying to do is basically dynamically add ion-cards with each clicking will send different data to next page.

However how can I pass someData to nextPage()? I tried nextPage({{ item[0] }}) but it goes me a template error.

Thanks guys!

Posts: 5

Participants: 3

Read full topic

swipeLeft(), swipeRight() events no longer working in ionic 4

$
0
0

@JohnOldman wrote:

Hi,
I’m upgrading an app to ionic 4 and noticed that the swipeLeft() and swipeRight() events that I used to implement custom functionality no longer appear to be working. I couldn’t find anything in the docs about it either. Have the function names changed? How can I bind custom code to swipe events in ionic 4?
Cheers
J

Posts: 2

Participants: 2

Read full topic

How can I well align span and icon on ionic listview

$
0
0

@pdj wrote:

Hello :slight_smile:
as you can see below pic…
It’s now vertically centered…like reorder icon…

  1. How can I vertically center on listview?
  2. when words in span is long enough, it goes to below of my star icon…
    I don’t want anything below start icon, How can I achieve it?
    my list view code is as below
  <ion-list reorder="true" (ionItemReorder)="reorderItems($event)">
        <!-- Sliding item -->
        <ion-item-sliding >
          <ion-item text-wrap  >     
               <img  style="width: 1.2em;
               height: 1.2em;" (click)="change(a)" class="iconic" src="assets/imgs/star_fill.png"/>
                   <span  >questionquestionquestionquestionquestionquestionquestion</span> 
          </ion-item>
          <ion-item-options>
            <button ion-button color="primary" (click)="delete(a)">delete</button>
          </ion-item-options>
        </ion-item-sliding>
      </ion-list>

12

Posts: 1

Participants: 1

Read full topic

[Ionic 4] Android hardware back button bug?

$
0
0

@alex87 wrote:

Using the Android hardware back button when there is only one page on the navigation stack reloads the app rather than exiting. Is this bug or intended?

Posts: 1

Participants: 1

Read full topic

[ionic 4] How to use Pipe in replace HTML markup?

$
0
0

@Alhamou wrote:

How can use Pipe in replace function with HTML markup in Angular?

Angular HTML:

<ion-list class="item-autocom" *ngFor="let word of words">
    {{ word | replace }}
</ion-list>

Angular TS Pipe:

import { Pipe, PipeTransform } from '@angular/core';

@Pipe({
  name: 'replace'
})
export class ReplacePipe implements PipeTransform {
  transform(value: any, args?: any): any {

    return value.replace('h', 'gi', '<b>DISCOURSE_PLACEHOLDER_1</b>');

  }
}

This is the output:

<b>$&</b> allo

But I need:

hallo

Posts: 1

Participants: 1

Read full topic


Any idea how to detect which text is dragged?

$
0
0

@pdj wrote:

I want this functionality.
when I select some text by dragging, and then, I click my custom button to make those selected text red(or whatever color).
to do so, I should know which text is selected when I click my button,
how can I achieve that?

Posts: 1

Participants: 1

Read full topic

Ionic 4 - how to pass param between tabs

$
0
0

@haythoo wrote:

Hello,

I’m using ionic rc1, any idea about passing param between tabs?

for example, I need to view shop profile, the shop id is 1, the shop profile have 4 tabs, profile, products, offers and branches. I need to pass the shop id between tabs so I can query the shop in the database.

Thanks

Posts: 2

Participants: 1

Read full topic

Ionic4 ,Pictures on the slides TAB Click will be magnified,why?

$
0
0

@sct-lwang wrote:

html :
<ion-slides #slides *ngIf="!showSlides" pager=“true” [options]=“slideOpts” mode=“ios” (ionSlideWillChange)=“slidesChange()”>

<ion-slide>

<img src=“assets/images/guide1.jpg” style=“width:100%;height:180px;” />

</ion-slide>

<ion-slide>

<img src=“assets/images/guide2.jpg” style=“width:100%;height:180px;” />

</ion-slide>

<ion-slide>

<img src=“assets/images/guide3.jpg” style=“width:100%;height:180px;” />

</ion-slide>

</ion-slides>

In the Google Chrome click image will be magnified

Posts: 1

Participants: 1

Read full topic

Multi app loaded same app first page

$
0
0

@fongkai0809 wrote:

I had develop 2 app with sharing some of the resources like the images and some similar code.
The case happen is like this:
IOS:
App A is Landscape
App B is Portrait
1 - press on App A
2 - press home button while splash page show up
3 - press on App B
4 - App B show up splash page
5 - App B show up the first page(login page) of the App A

The core problem is App B would show up App A’s first page,
if i do it in another way, App A won’t show up App B;s first page.

This make me feel very confuse, and i trapped here for weeks,
could any one please help me to find out how to fix it???

Posts: 1

Participants: 1

Read full topic

Help not able to click the page components

$
0
0

@Hidear wrote:

Hi. I am having problem with my one of my component.
I used product in component
In Home, I also loaded the the problem component It is fine.

However, When I try to Click the product area (Red Square area in the picture).
Scrolling, clicking is not working at all.

What kind of thing causes this problem?

If there isn’t any problem with the code,
Is there any possible thing I modified?

PLEASE HELP ME!!

Posts: 1

Participants: 1

Read full topic

Viewing all 48983 articles
Browse latest View live


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