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

Ionic 4, background image

$
0
0

@TaimoorMughal wrote:

Hello,
I am trying to add image on my home screen as i am getting image path from api so i’m using style="background-image: url({{flag}})", i want to add multiple images on my background. Or you can say i want to add 2 images one half of screen will have one flag and the other half will have the second flag.

<ion-content>
   <div style="background-image: url({{toFlag}})">
   <div style="background-image: url({{fromFlag}})">

  <.......Code......>

   </div>
   </div>
</ion-content>

How can i be able to add 2 images on ion-content by giving them 2 parts.
Thanks

Posts: 4

Participants: 2

Read full topic


Updating ionselect after its rendered

$
0
0

@mrcameron999 wrote:

Hi im needing a little help. I have googled around but havent figured how to do it.
I have a IonSelect component and the options are retreaved from an array that is fetched from my server. The array works all fine however the options do not update. Im guessing the work that populates the array runs after the component is rendered. Im not sure how to solve this but i was thinking of running the code before the component is rendered. However i will then encountered another issue. I have another ionselect that will change the result depending on what is selected in the first ionselect Any ideas i hope this makes sence
thanks!
my code

 <IonItem onClick={callFuncToPopularArray}>
      <IonLabel>Select Option</IonLabel>
      
        <IonSelect multiple={false} interface="alert" cancelText="Cancel" okText="Confirm">
        {array.map(elem  => (
          <IonSelectOption key={elem.id} value={elem.id} >{elem.data().name}
          </IonSelectOption>))}
        </IonSelect>

          
      </IonItem>
      <IonItem>
      <IonLabel>Select second option</IonLabel>
//This is where i would get the data from the database depending on the option above but not go to that yet
        <IonSelect multiple={false} interface="alert" cancelText="Cancel" okText="Confirm">
        {array2.map(elem  => (
          <IonSelectOption key={elem.name} value={elem.name} >{elem.name}</IonSelectOption>
          
    

          ))}
        </IonSelect>
      </IonItem>

Posts: 1

Participants: 1

Read full topic

Where is list of Ionic 4 icons

$
0
0

@Liquidcms wrote:

There used to be a website that listed the Ionic 4 icons; but it seems to have been replaced by the list of Ionic 5 icons. My guess is these go with Ionic 5, correct. As i pick one from the list and it doesn’t show anything in my Ionic 4 app.

Posts: 1

Participants: 1

Read full topic

How to refresh a page for only one time?

$
0
0

@scharli wrote:

I wants to refresh a page for only one time using angular 7.

I have tried
ngOnInit(){
let win = (window as any);
if(win.location.search !== ‘?loaded’ ) {
win.location.search = ‘?loaded’;
win.location.reload();
}
}
but this code refresh the page continuously.
Please someone give me solution, Thanks in advance.

Posts: 1

Participants: 1

Read full topic

Collapsible Title on Android

$
0
0

@psenechal wrote:

I have collapsible title/header working perfectly fine on iOS, but I launched an Android simulator and noticed that it doesn’t function at al…the title is out of place and it doesn’t behave the samel. Is that expected? Is that feature only available for iOS? Thanks.

Posts: 1

Participants: 1

Read full topic

Want to add one more character to dayValues in ion-datetime

$
0
0

@pdj wrote:

스크린샷 2020-03-03 오후 2.56.01

I added one more character after month, but can’t add it to day values.

<ion-datetime displayFormat="YYYY/MMM/D" dayValues="1일,2일,3일,04,05,06,08,09,10, 11, 12, 13, 14" pickerFormat="YYYY/MMM/D" monthShortNames='1월, 2월, 3월, 4월, 5월, 6월, 7월, 8월, 9월, 10월, 11월, 12월' doneText="확인" cancelText="취소" ></ion-datetime>

I tested it as above adding one more character to dayvalues, but it’s works same as above, not showing character but only number
I wrapped ’ ’ but in that cases , it’s not showing values
how can I add one more character to day values?

Posts: 1

Participants: 1

Read full topic

Using Gestures Utility

$
0
0

@briant wrote:

I’m trying to use the Gesture utility with code below directly from example on site…
and getting this error:
Error:

> "Uncaught TypeError: Cannot read property ‘__zone_symbol__addEventListener’ of null"

Code using:

pg = document.querySelector('.ppp');
    gesture: Gesture = createGesture({
        el: document.querySelector('.target-section'),
        threshold: 15,
        gestureName: 'my-gest',
        onMove: (detail) => { 
            console.log('test');
            //this.onMove(detail)
        }
    });

    //gesture.enable();

    onMove = (detail:any) => {
        console.log('IN IN IN MOVE!');
        const type = detail.type;
        const currentX = detail.currentX;
        const deltaX = detail.deltaX;
        const velocityX = detail.velocityX;
        //let pg = document.querySelector('p');
        this.pg.innerHTML = `
    <div>Type: ${type}</div>
    <div>Current X: ${currentX}</div>
    <div>Delta X: ${deltaX}</div>
    <div>Velocity X: ${velocityX}</div>
  `
    }

I’m triggering on a button call when clicked … any ideas anyone? and thaaanks! in advance

Posts: 1

Participants: 1

Read full topic

Ionic 4 code map not work on android but work on ios

$
0
0

@sehsah2020 wrote:

hi,
i need ask about my code it,
show location user and can click in mark to get new location and address
it worked well on web and ios but on android show blank white
why ??? where problem


 ionViewDidLoad() {
    this.platform.ready().then(() => {
      this.loadMap();
    });
  }

loadMap() {

    Environment.setEnv({
      'API_KEY_FOR_BROWSER_RELEASE': '(``)',
      'API_KEY_FOR_BROWSER_DEBUG': ''
    });

    LocationService.getMyLocation().then((myLocation: MyLocation) => {
      let options: GoogleMapOptions = {
        camera: {
          target: myLocation.latLng,
          zoom: 17,
        }
      };
      this.map = GoogleMaps.create('map_canvas', options);
      this.marker = this.map.addMarkerSync({
        title: 'Ionic',
        icon: {
          url: 'assets/images/place2.png',
          size: {
            width: 32,
            height: 32
          }
        },
        position: myLocation.latLng,
      });
      this.marker.on(GoogleMapsEvent.MARKER_CLICK)
      this.map.on(GoogleMapsEvent.MAP_CLICK).subscribe((data) => {
        this.lat = data['0']['lat']
        this.lat = data['0']['lng']
        console.log(data['0']['lat'], data['0']['lng'])
        localStorage.setItem('latitude', data[0]['lat'])
        localStorage.setItem('longitude', data[0]['lng'])
        localStorage.setItem('district', data[0]['subLocality'])
        this.GetNewlocation(data['0']['lat'], data['0']['lng'])
        this.marker.remove()
        this.marker = this.map.addMarkerSync({
          title: 'Ionic',
          icon: {
            url: 'assets/images/place2.png',
            size: {
              width: 32,
              height: 32
            }
          },
          position: { lat: data['0']['lat'], lng: data['0']['lng'] },
        });
        this.marker.on(GoogleMapsEvent.MARKER_CLICK)
      }
      );

    });

  }

Posts: 1

Participants: 1

Read full topic


Different lists in different slides scrolling at same time

$
0
0

@RodrigoSaPessoa wrote:

I have two ionic slides, each containing a regular list.
My problem is that each time I scroll on one of them, the other scrolls at the same time.

Is there a way to make each list scroll individually?

My code somewhat like this:

 <ion-content>
  <ion-slides>
   <ion-slide>
    <ion-list>
    ...
    </ion-list>
   </ion-slide>
   <ion-slide>
    <ion-list>
    ...
    </ion-list>
   </ion-slide>
  </ion-slides>
 </ion-content>

Thank you

Posts: 1

Participants: 1

Read full topic

How can I view the images made in the Ionic tutorial photo gallery app

$
0
0

@rvrwow wrote:

Hi,

I followed the Ionic v4 tutorial and ‘created’ the photo gallery app as found in the Ionic documentation.
I now tried to expand here by using Photoviewer to view the image.
In the example code this is given:

*ngFor="let photo of photoService.photos; index as position"> <ion-img src="{{ photo.base64 ? photo.base64 : photo.webviewPath }}" (click)="showActionSheet(photo, position)"></ion-img>

This displays the photos in the gallery. I now tried to give showActionSheet another argument which would be used with Photoviewer to find the location. However, if I try (click)="showActionSheet(photo, position,photo.webviewPath)
or photo.base64 ? photo.base64 : photo.webviewPath
I do see that the Photoviewer on my phone is working but it gives an error that it cannot find the image. Would anyone know how to correctly link to an image from local storage?

Posts: 1

Participants: 1

Read full topic

Issue with offset-top on ion-content in Ionic 5

$
0
0

@neamtua wrote:

Hello,

I’m trying to have a transparent header with toolbar over my content in my Angular Ionic 5 project.

The problem with the content is that, while it scrolls under the header and the header is transparent, when the page renders the content is actually spaced after the header.

I’ve noticed in css that ion-content has --offset-top set to something like 44px
If i try to remove that offset and set it to 0, the content looks ok on certain resolutions, but on others it places the content way above, cutting it off.

I have no idea what else to do. Everything I found online, mostly regarding to ionic 4, just setting the css of the header to transparent background and fullscreen on content should’ve worked… except it doesn’t. I have run out of ideas. Please help.

<ion-header mode="ios">
  <ion-toolbar>
    <ion-buttons slot="start">
      <ion-menu-button color="dark">
        <img src="assets/Meniu_Icon_1.png" />
      </ion-menu-button>
    </ion-buttons>
  </ion-toolbar>
</ion-header>

<ion-content fullscreen="true">
  <ion-slides pager [options]="slideOptsOne">
    <ion-slide>
      <div class="slide">
        <img src="assets/listing/Container_poza_1.png"/>
      </div>
    </ion-slide>
    <ion-slide>
      <div class="slide">
        <img src="assets/listing/Container_poza_2.png"/>
      </div>
    </ion-slide>
    <ion-slide>
      <div class="slide">
        <img src="assets/listing/Container_poza_3.png"/>
      </div>
    </ion-slide>
  </ion-slides>
</ion-content>
ion-toolbar {
    --background: transparent !important;
    --ion-color-base: transparent !important;
    --border-color: transparent;
}

ion-content {
    --offset-top: 0 !important;
}

Posts: 1

Participants: 1

Read full topic

Problems with Ionic 4 and Braintree on iOS - App Crashes

$
0
0

@ciccilleju wrote:

hello!

I really need your help :frowning:
I’m doing an app with Ionic 4 and cordova-plugin-braintree version 0.5.1 (i tried the other forks but i can’t compile).

With Android everything works fine.

With iOs i’m having trouble making it work:

I can access the paypal account, choose the card and the payment method but when i choose to pay the app crashes and i get this error:

2020-03-03 10:45:27.414499+0100 Single Fin App[53289:11332367] Connection 7: unable to determine interface type without an established connection
2020-03-03 10:45:27.414547+0100 Single Fin App[53289:11332367] Connection 7: unable to determine fallback status without a connection
2020-03-03 10:45:29.186 Single Fin App[53289:11316095] Untrusted SSL certificate chain. Refusing to communicate with PayPal servers.
2020-03-03 10:45:29.189591+0100 Single Fin App[53289:11332366] Task <01FE38F8-CD3E-478A-ADEE-5CFD2F8E8994>.<0> HTTP load failed, 0/0 bytes (error code: -999 [1:89])
2020-03-03 10:45:36.659198+0100 Single Fin App[53289:11316095] CDVIonicKeyboard: updating frame
2020-03-03 10:45:39.434503+0100 Single Fin App[53289:11316095] CDVIonicKeyboard: updating frame
2020-03-03 10:45:43.809588+0100 Single Fin App[53289:11316095] CDVIonicKeyboard: updating frame
2020-03-03 10:45:49.196546+0100 Single Fin App[53289:11316095] CDVIonicKeyboard: updating frame
2020-03-03 10:45:55.487106+0100 Single Fin App[53289:11316095] *** Terminating app due to uncaught exception ‘NSInvalidArgumentException’, reason: ‘*** -[__NSPlaceholderDictionary initWithObjects:forKeys:count:]: attempt to insert nil object from objects[3]’
*** First throw call stack:
(
0 CoreFoundation 0x00000001036ed27e __exceptionPreprocess + 350
1 libobjc.A.dylib 0x0000000101d00b20 objc_exception_throw + 48
2 CoreFoundation 0x000000010377fab1 _CFThrowFormattedException + 194
3 CoreFoundation 0x000000010378a4c6 -[__NSPlaceholderDictionary initWithObjects:forKeys:count:].cold.4 + 38
4 CoreFoundation 0x000000010374ad97 -[__NSPlaceholderDictionary initWithObjects:forKeys:count:] + 247
5 CoreFoundation 0x00000001036e912b +[NSDictionary dictionaryWithObjects:forKeys:count:] + 59
6 Single Fin App 0x0000000100b58ff8 -[BraintreePlugin getPaymentUINonceResult:] + 1928
7 Single Fin App 0x0000000100b58597 -[BraintreePlugin dropInViewController:didSucceedWithTokenization:] + 183
8 BraintreeUI 0x000000010106c610 -[BTDropInViewController informDelegateDidAddPaymentInfo:] + 140
9 BraintreeUI 0x000000010106e4b5 -[BTDropInViewController paymentButtonDidCompleteTokenization:fromViewController:error:] + 266
10 BraintreeUI 0x0000000101069256 __44-[BTDropInViewController initWithAPIClient:]_block_invoke + 82
11 BraintreePayPal 0x0000000100fd4697 __57-[BTPayPalDriver setAppSwitchReturnBlock:forPaymentType:]_block_invoke_3 + 254
12 libdispatch.dylib 0x0000000105d78dd4 _dispatch_call_block_and_release + 12
13 libdispatch.dylib 0x0000000105d79d48 _dispatch_client_callout + 8
14 libdispatch.dylib 0x0000000105d87de6 _dispatch_main_queue_callback_4CF + 1500
15 CoreFoundation 0x0000000103650049 CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE + 9
16 CoreFoundation 0x000000010364aca9 __CFRunLoopRun + 2329
17 CoreFoundation 0x000000010364a066 CFRunLoopRunSpecific + 438
18 GraphicsServices 0x0000000108bcdbb0 GSEventRunModal + 65
19 UIKitCore 0x000000010c0fdd4d UIApplicationMain + 1621
20 Single Fin App 0x0000000100b56811 main + 65
21 libdyld.dylib 0x0000000105e01c25 start + 1
22 ??? 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)

this is my AppDelegate file

@implementation AppDelegate

  • (BOOL)application:(UIApplication*)application didFinishLaunchingWithOptions:(NSDictionary*)launchOptions
    {
    self.viewController = [[MainViewController alloc] init];
    [BTAppSwitch setReturnURLScheme:@“com.nastydevops.singlefin.payments”];
    return [super application:application didFinishLaunchingWithOptions:launchOptions];

}

  • (BOOL)application:(UIApplication *)application
    openURL:(NSURL *)url
    options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options {
    if ([url.scheme localizedCaseInsensitiveCompare:@“com.nastydevops.singlefin.payments”] == NSOrderedSame) {
    return [BTAppSwitch handleOpenURL:url options:options];
    }
    return NO;
    }

@EnD

Do you have any idea?

thanks!

Posts: 1

Participants: 1

Read full topic

Setting --background on ioc-content variable hides Google Map

$
0
0

@viiskis wrote:

Setting --background variable on ioc-content hides my embeded Google Map. How I can change the background and still see my map?

Posts: 2

Participants: 2

Read full topic

Cordova plugin firebase not working in ionic 3

$
0
0

@rajubootla wrote:

Dear Community,
I am struggling with firebase plugin in ionic 3. But no one is working,
because of some plugin build failed or m not getting token.
I am using ionic 3 with angular 5, I just want push notification,Crashlytic using firebase
Please help and guide me. Thanks

1.step==>Add plugin

ionic cordova plugin add cordova-plugin-firebase npm install --save @ionic-native/firebase@4

2.Step==>Add platform
ionic cordova platform add android@8.1.0

3.step ==>Build Android
ionic cordova run android --devices

Error==>

i got error like this plugin_not_installed

Try===>
i was try to this step
1.remove platform or add platform
2.remove plugins or add plugins
3.delete node-modules and reinstall npm

====> not working

Ionic Info

cli packages: (C:\Users\PC\AppData\Roaming\npm\node_modules)

@ionic/cli-utils  : 1.9.2
ionic (Ionic CLI) : 3.9.2

global packages:

Cordova CLI : 8.0.0

local packages:

@ionic/app-scripts : 3.1.9
Cordova Platforms  : android 8.1.0 browser 5.0.4 ios 5.1.1
Ionic Framework    : ionic-angular 3.9.2

System:

Android SDK Tools : 26.1.1
Node              : v8.11.2
npm               : 5.6.0
OS                : Windows 10

Posts: 4

Participants: 2

Read full topic

Ionic React - Styled components Unexpected token

$
0
0

@kolbis wrote:

I am using a third-party library that uses styled components
when trying to run ionic build I am getting: “Module parse failed: Unexpected token”
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders

the line that breaks the build is const Box = props => <StyledBox {…props} />;
inside this file Box.jsx
import React from ‘react’;

import styled from ‘styled-components’;

import PropTypes from ‘prop-types’;

import { match } from ‘…/…/…/helpers/styledIs’;

// CONSTS

export const DIRECTION_OPTIONS = [‘row’, ‘rowReverse’, ‘column’, ‘columnsReverse’];

export const DEFAULT_DIRECTION = ‘row’;

export const WRAP_OPTIONS = [‘nowrap’, ‘wrap’, ‘wrapReverse’];

export const DEFAULT_WRAP = ‘nowrap’;

export const ALIGN_ITEMS_OPTIONS = [‘stretch’, ‘center’, ‘start’, ‘end’, ‘baseline’];

export const DEFAULT_ALIGN_ITEMS = ‘stretch’;

export const ALIGN_CONTENT_OPTIONS = [

‘stretch’,

‘center’,

‘start’,

‘end’,

‘spaceBetween’,

‘spaceAround’,

‘spaceEvenly’,

];

export const DEFAULT_ALIGN_CONTENT = ‘stretch’;

export const JUSTIFY_CONTENT_OPTIONS = [

‘center’,

‘start’,

‘end’,

‘spaceBetween’,

‘spaceAround’,

‘spaceEvenly’,

];

export const DEFAULT_JUSTIFY_CONTENT = ‘start’;

const StyledBox = styled.div`

width: ${props => props.width};

height: ${props => props.height};

display: flex;

flex-direction: row;

flex-wrap: nowrap;

justify-content: flex-start;

align-content: stretch;

/********************************* display *********************************/

/***************** http://cssreference.io/property/display *****************/

${match(‘inline’, true)`

display: inline-flex;

`};

/******************************** direction ********************************/

/************** http://cssreference.io/property/flex-direction **************/

${match(‘direction’, ‘row’)`

flex-direction: row; /* default */

`};

${match(‘direction’, ‘rowReverse’)`

flex-direction: row-reverse;

`};

${match(‘direction’, ‘column’)`

flex-direction: column;

`};

${match(‘direction’, ‘columnReverse’)`

flex-direction: column-reverse;

`};

/*********************************** wrap ***********************************/

/**************** http://cssreference.io/property/flex-wrap ****************/

${match(‘wrap’, ‘nowrap’)`

flex-wrap: nowrap; /* default */

`};

${match(‘wrap’, ‘wrap’)`

flex-wrap: wrap;

`};

${match(‘wrap’, ‘wrapReverse’)`

flex-wrap: wrap-reverse;

`};

/***************************** justify-content *****************************/

/************* http://cssreference.io/property/justify-content *************/

${match(‘justifyContent’, ‘start’)`

justify-content: flex-start; /* default */

`};

${match(‘justifyContent’, ‘end’)`

justify-content: flex-end;

`};

${match(‘justifyContent’, ‘center’)`

justify-content: center;

`};

${match(‘justifyContent’, ‘spaceBetween’)`

justify-content: space-between;

`};

${match(‘justifyContent’, ‘spaceAround’)`

justify-content: space-around;

`};

${match(‘justifyContent’, ‘spaceEvenly’)`

justify-content: space-evenly;

`};

/****************************** align-content ******************************/

/************** http://cssreference.io/property/align-content **************/

${match(‘alignContent’, ‘start’)`

align-content: flex-start;

`};

${match(‘alignContent’, ‘end’)`

align-content: flex-end;

`};

${match(‘alignContent’, ‘center’)`

align-content: center;

`};

${match(‘alignContent’, ‘spaceBetween’)`

align-content: space-between;

`};

${match(‘alignContent’, ‘spaceAround’)`

align-content: space-around;

`};

${match(‘alignContent’, ‘spaceEvenly’)`

align-content: space-evenly;

`};

${match(‘alignContent’, ‘stretch’)`

align-content: stretch; /* default */

`};

/******************************* align-items *******************************/

/*************** http://cssreference.io/property/align-items ***************/

${match(‘alignItems’, ‘start’)`

align-items: flex-start;

`};

${match(‘alignItems’, ‘end’)`

align-items: flex-end;

`};

${match(‘alignItems’, ‘center’)`

align-items: center;

`};

${match(‘alignItems’, ‘baseline’)`

align-items: baseline;

`};

${match(‘alignItems’, ‘stretch’)`

align-items: stretch;

`};

`;

const Box = props => <StyledBox {…props} />;

Box.defaultProps = {

inline: false,

direction: DEFAULT_DIRECTION,

wrap: DEFAULT_WRAP,

alignItems: DEFAULT_ALIGN_ITEMS,

alignContent: DEFAULT_ALIGN_CONTENT,

justifyContent: DEFAULT_JUSTIFY_CONTENT,

width: ‘auto’,

height: ‘auto’,

};

Box.propTypes = {

/** Sets display to inline-flex.

  • If true, element will not end with a line break.

*/

inline: PropTypes.bool,

/** Establishes the main-axis direction flow of the box. */

direction: PropTypes.oneOf(DIRECTION_OPTIONS),

/** Set how box item will be wrapped. */

wrap: PropTypes.oneOf(WRAP_OPTIONS),

/** This defines the default behavior for how flex items are laid out

  • along the cross axis on the current line.

*/

alignItems: PropTypes.oneOf(ALIGN_ITEMS_OPTIONS),

/** This aligns a flex container’s lines within when there is extra space in the cross-axis */

alignContent: PropTypes.oneOf(ALIGN_CONTENT_OPTIONS),

/** This aligns a flex container’s lines within when there is extra space in the main-axis */

justifyContent: PropTypes.oneOf(JUSTIFY_CONTENT_OPTIONS),

/** The width of the box */

width: PropTypes.string,

/** The height of the box */

height: PropTypes.string,

};

export default Box;

Any idea how can i solve it?

Posts: 1

Participants: 1

Read full topic


Ion-slides Performance Issue

$
0
0

@gdeveloper18 wrote:

We are using ion-nav inside ion-slide (linked with ion-segment) in order to achieve swipeable feature (like swipeable tabs).

No problems with browsers and android, but when testing with iPad the app starts very slow and then a white to death screen is present knowing that the app is running perfectly on iPhone.

There are about 12 slides viewed at the same time. We tried to present only 3 slides, so the app did not show white screen, but it was very slow!

It is strange how it is running on iPhones very smoothly but on iPad is showing white to death screen!

We had removed all unwanted plugins and re-added a fresh ios platform in our ionic project, and tested the app with and without the --prod flag, but the same result!

Any one have an idea?!

Tested iPad: iPad mini 2 - version 12.4.4
Tested iPhones version 13.x.x

This is the memory status when debugging on iPad with XCode.

Posts: 1

Participants: 1

Read full topic

Increase width of Alert Controller

$
0
0

@mulla-azzi wrote:

I would like to know, how can i increase width of an Alert Controller in ionic4.

I have tried many techniques but haven’t succeeded in any. I have created a stackblitz example for clarity. Here i have button on click of which, the alert appears but i want the alert to be more broad. I have also added a css variable to change the width but it also doesn’t work

ion-alert{
  --width: 400px;
}

StackBlitz example

Posts: 6

Participants: 2

Read full topic

Ionic 5 - ion-select close popover from code

$
0
0

@Exers wrote:

What I’m trying to achieve is to have ion-select with ion-select-options in it, but I don’t want popover to show once I click on it… Is there a way to achieve this? Is this even possible to do? - I would guess there’s something like interface=“none”? Or maybe this can be done by css? I know it a weird thing to do but I need such a feature…Thanks in advance.

Posts: 2

Participants: 2

Read full topic

Two tabs selected after router.navigate()

$
0
0

@marcinni2 wrote:

Hello,

I have a problem with navigating user in my App, when he clicks “Back” on his device. I want to let him exit the app from the first tab and it works. From other tabs, I want to redirect him to the first tab.

It works, but two tabs on the tab-bar are selected/active. I was trying maaany things all day and nothing worked.

I found exactly the same issue on StackOverflow and commented on it there to don’t double the topic.

If You would like to respond there or here -> I would really appreciate!

Cheers!

Posts: 1

Participants: 1

Read full topic

Promise returning Subscription, how to wait for data before proceding

$
0
0

@leonardofmed wrote:

I have a function that get some data from DB, store in localStorage and then do something with it. To get the data I’m using the Angular’s HttpClient, which uses Observables in its methods. The problem I’m facing is that when processData() is fired, the localStorage was not populated yet.

Here is how I’m doing the coding so far:

mainFunction(): Promise<void> {
	return this.getData().then(() => {
  		return this.processData().then(() => {
  			//...
  		})
  	})
}

// Get data from DB and then store in localStorage
getData(): Promise<Subscription> {
	// Declare some data to send
	//...

	return this.http.post(myLink, myArray, httpOptions)
	.subscribe(res => {
		// Store retrieved data in localStorage
		return this.storeData(res);
	});
}

I can’t just get the data from getData() and pass to processData, for some other reasons I need to update the localStorage before proceed. I believe this situation is happening because I’m returning a Subscription to processData() and not the updated localStorage data, which is my objective. I tried to do this in some ways, as stated here using map(), but this generate some other errors. Is there other method that I can use to acomplish what I want?

Posts: 3

Participants: 2

Read full topic

Viewing all 49526 articles
Browse latest View live


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