@sehsah2020 wrote:
hi,
i use localstorage to store data
how can remove storage after close app in background
or use not used app in 30 minut
Posts: 2
Participants: 2
@sehsah2020 wrote:
hi,
i use localstorage to store data
how can remove storage after close app in background
or use not used app in 30 minut
Posts: 2
Participants: 2
@AvkAvk wrote:
Here we go . I was trying to create build a new project which is on es2018 version . i also my cli also updated
and even i facing this problem to generating the build it show some babel issue or missing eve.but it thing my version is stil work on es5 because i have ionic 4 application at that application during making build facing not error issue generating build
please help me ,
ionic Developererror issue "
An unhandled exception occurred: [BABEL] D:\wfh\newProjectDir\NautApp\www\common-es2015.e374ccc1d2ec82e4169d.js: Could not find plugin “proposal-numeric-separator”. Ensure the
re is an entry in ./available-plugins.js for it. (While processing: “D:\wfh\newProjectDir\NautApp\node_modules\@angular-devkit\build-angular\node_modules\@babel\prese
t-env\lib\index.js”)
See “C:\Users\AwkAwk\AppData\Local\Temp\ng-eKdl1X\angular-errors.log” for further details.
[ERROR] An error occurred while running subprocess ng."
Posts: 1
Participants: 1
@alexortizl wrote:
I’m developing an Ionic 5 App. I was testing a component like this:
beforeEach(async(() => { TestBed.configureTestingModule({ declarations: [HomePage], imports: [MocksModule, IonicModule.forRoot()] }).compileComponents(); fixture = TestBed.createComponent(HomePage); component = fixture.componentInstance; fixture.detectChanges(); }));
It was working fine but after I added:
<ion-button routerLink="/settings"> <ion-icon slot="icon-only" name="settings-outline"></ion-icon> </ion-button>
The test fails with:
Failed: R3InjectorError(DynamicTestModule)[NavController -> UrlSerializer -> UrlSerializer]: NullInjectorError: No provider for UrlSerializer!
In
MocksModule
I export a stub directive as recommended in the Angular docs I believe the error is related to the implementation ofRouterLink
insideIonicModule
.
Posts: 1
Participants: 1
@sinergyamx wrote:
Hi there I’m trying to implement a tabs component inside of other components I was able to render it with out any issue but at the moment I’m trying to click it I get this error:
ERROR Error: Uncaught (in promise): Error: Cannot match any routes. URL Segment: 'galeria/anuncios' Error: Cannot match any routes. URL Segment: 'galeria/anuncios'
This is my navtabs.component.html
<div class="tabs"> <ion-tabs slot="bottom"> <ion-tab-bar slot="bottom"> <ion-tab-button tab="anuncios"> <ion-icon name="notifications"></ion-icon> <ion-label>Anuncios</ion-label> <ion-badge>6</ion-badge> </ion-tab-button> <ion-tab-button tab="liturgias"> <ion-icon name="albums"></ion-icon> <ion-label>Liturgias</ion-label> </ion-tab-button> <ion-tab-button tab="trabajos"> <ion-icon name="briefcase"></ion-icon> <ion-label>Mis Trabajos</ion-label> </ion-tab-button> <ion-tab-button tab="galeria"> <ion-icon name="images"></ion-icon> <ion-label>Galeria </ion-label> </ion-tab-button> </ion-tab-bar> </ion-tabs> </div>
Here is my navtabas.component.ts
import { CommonModule} from '@angular/common'; import { Component, OnInit, NgModule } from '@angular/core'; import { Routes, RouterModule, Router } from '@angular/router'; import { from } from 'rxjs'; import { IonicModule } from '@ionic/angular'; import { RouteReuseStrategy} from '@angular/router'; @Component({ selector: 'navtabs', templateUrl: './navtabs.component.html', styleUrls: ['./navtabs.component.scss'], }) export class NavTabsComponent implements OnInit { constructor() { } ngOnInit() {} }
Here is my app-routing.module.ts
import { NgModule, Component } from '@angular/core'; import { PreloadAllModules, RouterModule, Routes } from '@angular/router'; import { componentFactoryName } from '@angular/compiler'; import { AnunciosComponent } from './components/anuncios/anuncios.component'; import { GaleriaComponent } from './components/galeria/galeria.component'; import { LiturgiasComponent } from './components/liturgias/liturgias.component'; import { TrabajosComponent } from './components/trabajos/trabajos.component'; import { PerfilComponent } from './components/perfil/perfil.component'; import { RegistroComponent } from './components/registro/registro.component'; import { LoginComponent } from './components/login/login.component'; import { PagosComponent } from './components/pagos/pagos.component'; const routes: Routes = [ { path: '', redirectTo: 'home', pathMatch: 'full' }, { path: 'home', loadChildren: () => import('./pages/home/home.module').then( m => m.HomePageModule) }, { path: 'login', loadChildren: () => import('./pages/login/login.module').then( m => m.LoginPageModule) }, { path: 'register', loadChildren: () => import('./pages/register/register.module').then( m => m.RegisterPageModule) }, { path: 'profile', loadChildren: () => import('./pages/profile/profile.module').then( m => m.ProfilePageModule) }, { path: 'pagos', loadChildren: () => import('./pages/pagos/pagos.module').then( m => m.PagosPageModule) }, { path: 'pagos', component: PagosComponent}, { path: 'login', component: LoginComponent }, { path: 'registro', component: RegistroComponent}, { path: 'perfil', component: PerfilComponent}, { path: 'anuncios', component: AnunciosComponent}, { path: 'galeria', component: GaleriaComponent}, { path: 'liturgias', component: LiturgiasComponent}, { path: 'trabajos', component: TrabajosComponent} ]; @NgModule({ imports: [ RouterModule.forRoot(routes, { preloadingStrategy: PreloadAllModules }) ], exports: [RouterModule] }) export class AppRoutingModule {}
Can someone put me in the right direction Any help is most appreciated?
Posts: 1
Participants: 1
@syedarsalan wrote:
homeservice.ts
codeimport { Injectable } from ‘@angular/core’;
import { HttpClient } from ‘@angular/common/http’;
import { Observable } from ‘rxjs’;
import { interfacedata } from ‘./interfacedata’;@Injectable({
providedIn: ‘root’
})export class HomeService {
data: any;
url="./assets/data/data.json";constructor(private http:HttpClient) { }
getHomeData():Observable<interfacedata>{
return this.http.get<interfacedata>(this.url);
}
}pakistan.html
Pakistan Team Players
code<ion-item *ngFor="let p of player" routerLink="{{p.link}}"> <img src="{{p.img}}" />{{p.name}} </ion-item> </ion-list>
pakistan.ts
codeimport { Component, OnInit } from ‘@angular/core’;
import { HomeService } from ‘src/app/Services/home.service’;@Component({
selector: ‘app-pakistan’,
templateUrl: ‘./pakistan.page.html’,
styleUrls: [’./pakistan.page.scss’],
})export class PakistanPage implements OnInit {
player:any=;
constructor(
private homeservice:HomeService
) {}ngOnInit() {
this.homeservice.getHomeData()
.subscribe((data:any)=>{
this.player = data.pakistan;
});
}
}baberazam.html
{{playername}}
code<div class="img-box">
{{d.name}}
Born :{{d.born}}
Age :{{d.age}}
Playing Role :{{d.playingrole}}
Batting Style :{{d.battingstyle}}
Bowling Style :{{d.bowlingstyle}}
ODI Details
ODI Debut :{{d.odidebut}}
Matches :{{d.odimatches}}
Innings :{{d.odiinnings}}
Runs :{{d.odiruns}}
Strike Rate :{{d.odistrikerate}}
Best Score :{{d.odihighest}}
Average:{{d.odiaverage}}
Fities :{{d.odififty}}
Hundereds :{{d.odihundered}}
Fours :{{d.odifours}}
Sixes :{{d.odisixes}}
T20 Details
T20 Debut :{{d.t20debut}}
Matches :{{d.t20matches}}
Innings :{{d.t20innings}}
Runs :{{d.t20runs}}
Strike Rate :{{d.t20strikerate}}
Best Score :{{d.t20highest}}
Average:{{d.t20average}}
Fities :{{d.t20fifty}}
Hundereds :{{d.t20hundered}}
Fours :{{d.t20fours}}
Sixes :{{d.t20sixes}}
Test Details
Test Debut :{{d.testdebut}}
Matches :{{d.testmatches}}
Innings :{{d.testinnings}}
Runs :{{d.testruns}}
Strike Rate :{{d.teststrikerate}}
Best Score :{{d.testhighest}}
Average:{{d.testaverage}}
Fities :{{d.testfifty}}
Hundereds :{{d.testhundered}}
Fours :{{d.testfours}}
Sixes :{{d.testsixes}}
baberazam.ts
codeimport { Component, OnInit } from ‘@angular/core’;
import { HomeService } from ‘src/app/Services/home.service’;@Component({
selector: ‘app-baberazam’,
templateUrl: ‘./baberazam.page.html’,
styleUrls: [’./baberazam.page.scss’],})
export class BaberazamPage implements OnInit {
playername:any=;
constructor(
private homeservice:HomeService
) {}ngOnInit() {
this.homeservice.getHomeData()
.subscribe((data:any)=>{
this.playername = data.baberAzam;
});
}
}
Posts: 1
Participants: 1
@lenart wrote:
Hi,
I have problem whit adding a background image dynamically to toolbar.
I try whit:HTML <ion-toolbar [ngStyle]="mainBackground" [ngClass]="color == 53 ? 'pet' : 'not-pet'" class="single-header-bg"> TS: this.mainBackground: { background: 'url(' image/url ')', }
This returns
but i need to get --background, i try to insert in to TS --background but then it doesn’t appear at all.2. HTML <ion-toolbar [style.background]="bgImage" [ngClass]="color == 53 ? 'pet' : 'not-pet'" class="single-header-bg"> TS this.bgImage = 'url(' image/url ')',
This doesn’t return nothing, i just see on web some one make this work for a background-color.
Thank you for your help
Posts: 1
Participants: 1
@Lyhout wrote:
Hello, I got some issues from the app store because my app got White Screen after SplashScreen.
I try to change value SplashScreenDelay but it does not work.How can I solve it with ionic 4?
Posts: 1
Participants: 1
@lhk wrote:
I would like to create a custom web component with stencil, based on the ionic components.
As a starting point, I would like to create a minimal example with a popover.
So I created a stencil project, based on the ‘components’ starter template, installed ionic and addedimport '@ionic/core'
to my component.
Now it is possible to use ionic web components in the jsx, I’ve tried it with a simple button:
<ion-button>click me</ion-button>
. This works, there is now a blue button(For the development, I’m running
npm run build
and hosting the www folder withnpm serve
)The next step would be to add a popover and to wire it to the button. While the react component
IonPopover
has a convenientisOpen
prop, the ion-popover web component seems to have an imperative API:
If I understand this correctly, I need to get a reference to the dom element of the popover and call present() on it. This is the code I’ve created:
import { Component, Listen, h } from "@stencil/core"; import "@ionic/core"; @Component({ tag: "my-component", styleUrl: "my-component.css", shadow: true }) export class MyComponent { @Listen("click", { capture: true }) handleClick() { console.log("click"); (document.getElementById("popover") as any).present(); } render() { return ( <div> <ion-popover id="popover" component={<p>popover text</p>}></ion-popover> <ion-button>click me</ion-button> </div> ); } }
The click event is captured correctly, but it doesn’t find the popover element. The web console logs an error:
TypeError: document.getElementById(...) is null
Also, is there a way to get Typescript to play along with this? I would like to get autocompletion for the imperative API of the ionic web components. It seems to work for the jsx markup, since it automatically suggests events such as
onIonPopoverDismissed
Posts: 1
Participants: 1
@chager wrote:
I’m trying to navigate on level up with one of my pages.
this.router.navigate(['../'], { relativeTo: this.route });
Somehow this doesn’t work. Anyone any idea why this isn’t working? I’m using Angular 9
Posts: 1
Participants: 1
@lhk wrote:
My react app needs to load dynamic html at runtime. Inside of this html, I need to display small custom components.
At first I tried to render a separate react virtual dom for each of these custom components. But I think it might be cleaner to do this with web components. The components don’t need to react to the app state, I can just add
<my-component>
tags to the dynamic html.While the components don’t react to app state, they do need to communicate “user has interacted with me” to the rest of the app. It’s a one-way information flow, out of the dynamic html.
It seems like there are two ways to implement this:
- use querySelectors to find all the web components and give them a callback as a prop.
- dispatch a custom “user interaction” event
For now, I’m trying to make this second option, with custom events, work. And this is where I run into problems.
It’s not clear to me how to listen to custom events from components inside of the react dom. The react docs do say:Events emitted by a Web Component may not properly propagate through a React render tree. You will need to manually attach event handlers to handle these events within your React components.
But even when I manually attach event handlers, they don’t react to custom events.
To reproduce the problem, I’ve set up a minimal example. There are two divs in the dom, the outer one listens to custom events, the inner one hosts the react virtual dom. Inside of the virtual dom there are two components. The outer one is also a listener, the inner one dispatches the custom event.
The problem is: Only the outer div catches the event, react components can’t listen to it.
You can see the example here: https://codesandbox.io/s/quirky-cannon-in5u0
Or you can clone and edit a typescript version:
git clone https://github.com/lhk/react_custom_events cd react_custom_events npm i npm run start # browser opens, look at the console output
Posts: 1
Participants: 1
@karvanj wrote:
I have a PWA app in Ionic 5 (but I assume the same issue will apply to 4 as well). In short I have a couple of ion fab buttons. In ios if these buttons are double tap, the web browser annoyingly zooms in. Is there a way to prevent this behaviour?
I don’t need double tap so even if this prevent it would suffice for my application.Thanks in advance.
Posts: 1
Participants: 1
@Nats97 wrote:
I want to put some content o next line inside the
ion-item
but this doesn’t seems to be working.
I actually want the price to be on next line. and trash icon on right side
already triedion-text-wrap
and other thing, but still in vain.
here is how I’m trying
`
<ion-row> <ion-col size="12"> <ion-list> <ion-item *ngFor="let product of cart"> <ion-avatar [routerLink]="['/product-detail',product.id]"> <!-- <ion-thumbnail> --> <img src="{{product.images[0].src}}" /> <!-- </img> --> <!-- </ion-thumbnail> --> </ion-avatar> <ion-text [routerLink]="['/product-detail',product.id]" style="margin-left: 20px;"> {{product.name}}</ion-text> <hr /> <br/> <!-- <ion-text>{{product.price}}</ion-text> --> <div class="offer-details"> <!-- <ion-button style="padding:unset !important"> --> <ion-icon class='deleteIcon' name="trash" slot="icon-only"></ion-icon> <!-- </ion-button> --> </div> <ion-label> Price: {{product.price}} </ion-label> </ion-item> </ion-list> </ion-col> </ion-row> </ion-grid>
`
Thanks in advance to helping hands
Posts: 1
Participants: 1
@afelipelli wrote:
Hi Everybody,
I’m trying to open another topic about this since the other one is getting completely ignored:
Is this In App purchase 2 plugin not supported anymore? Or am I doing something wrong?
Thanks and regards,
Alex
Posts: 1
Participants: 1
@zubairkhanzhk wrote:
Hi, I am Zubair Hussain Khan, Co-founder at Reviewsed.com. Actually, I am looking for a Dev who and develop an app for my website that helps my visitors to convert YouTube to MP3? Is there anyone who can get this job done.
Posts: 1
Participants: 1
@ehboym wrote:
Hi,
I have or had a working Ionic Angular PWA.
On the last build the fillowing error started to come up:
ionic build > ng.cmd run app:build ERROR in Failed to list lazy routes: Unknown module 'E:/Erez/Projects/BLSProtocols_B/src/app/app.module#AppModule'. [ERROR] An error occurred while running subprocess ng. ng.cmd run app:build exited with exit code 1. Re-running this command with the --verbose flag may provide more information.
I cant understand what the problem is, it used to compile perfectlly.
Any insites ?
Thanks
ionic build --verbose ionic:lib Terminal info: { ci: false, shell: 'C:\\WINDOWS\\system32\\cmd.exe', tty: true, windows: true } +0ms ionic:lib CLI global options: { _: [ 'build' ], help: null, h: null, verbose: true, quiet: null, interactive: true, color: true, confirm: null, json: null, project: null, '--': [] } +3ms ionic:lib:project Project type from config: @ionic/angular (angular) +0ms ionic:lib:project Project details: { configPath: 'E:\\Erez\\Projects\\BLSProtocols_B\\ionic.config.json', errors: [], context: 'app', type: 'angular' } +1ms ionic Context: { binPath: 'C:\\Users\\user\\AppData\\Roaming\\npm\\node_modules\\@ionic\\cli\\bin\\ionic', libPath: 'C:\\Users\\user\\AppData\\Roaming\\npm\\node_modules\\@ionic\\cli', execPath: 'E:\\Erez\\Projects\\BLSProtocols_B', version: '6.3.0' } +0ms ionic:lib:build build options: { ionic:lib:build '--': [], ionic:lib:build engine: 'browser', ionic:lib:build platform: undefined, ionic:lib:build project: 'app', ionic:lib:build verbose: true, ionic:lib:build configuration: undefined, ionic:lib:build sourcemaps: undefined, ionic:lib:build cordovaAssets: true, ionic:lib:build watch: undefined, ionic:lib:build type: 'angular' ionic:lib:build } +0ms ionic:lib:telemetry Sending telemetry for command: 'ionic build' [ '--verbose', '--interactive', '--color' ] +0ms ionic:lib:hooks Looking for ionic:build:before npm script. +0ms ionic:lib:build Looking for ionic:build npm script. +27ms > ng.cmd run app:build --verbose ng:analytics getGlobalAnalytics +0ms ng:analytics Client Analytics config found: false +39ms ng:analytics Analytics disabled. Ignoring all analytics. +1ms ng:analytics getSharedAnalytics +0ms <w> [webpack.Progress] 3093ms building <i> [webpack.Progress] 16ms advanced chunk optimization <i> [webpack.Progress] 16ms hashing <i> [webpack.Progress] 23ms chunk assets processing <i> [webpack.Progress] 227ms after chunk asset optimization ERROR in Failed to list lazy routes: Unknown module 'E:/Erez/Projects/BLSProtocols_B/src/app/app.module#AppModule'. [ERROR] An error occurred while running subprocess ng. ng.cmd run app:build --verbose exited with exit code 1. Re-running this command with the --verbose flag may provide more information. ionic:utils-process onBeforeExit handler: 'process.exit' received +0ms ionic:utils-process onBeforeExit handler: running 1 functions +1ms ionic:utils-process error while killing process tree for 8308: Error: Command failed: taskkill /pid 8308 /T /F ionic:utils-process ERROR: The process "8308" not found. ionic:utils-process ionic:utils-process at ChildProcess.exithandler (child_process.js:303:12) ionic:utils-process at ChildProcess.emit (events.js:311:20) ionic:utils-process at maybeClose (internal/child_process.js:1021:16) ionic:utils-process at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5) { ionic:utils-process killed: false, ionic:utils-process code: 128, ionic:utils-process signal: null, ionic:utils-process cmd: 'taskkill /pid 8308 /T /F' ionic:utils-process } +414ms ionic:utils-process onBeforeExit handler: error from function: Error: Command failed: taskkill /pid 8308 /T /F ionic:utils-process ERROR: The process "8308" not found. ionic:utils-process ionic:utils-process at ChildProcess.exithandler (child_process.js:303:12) ionic:utils-process at ChildProcess.emit (events.js:311:20) ionic:utils-process at maybeClose (internal/child_process.js:1021:16) ionic:utils-process at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5) { ionic:utils-process killed: false, ionic:utils-process code: 128, ionic:utils-process signal: null, ionic:utils-process cmd: 'taskkill /pid 8308 /T /F' ionic:utils-process } +16ms ionic:utils-process processExit: exiting (exit code: 1) +9ms
Ionic: Ionic CLI : 6.3.0 (C:\Users\user\AppData\Roaming\npm\node_modules\@ionic\cli) Ionic Framework : @ionic/angular 5.0.7 @angular-devkit/build-angular : 0.803.25 @angular-devkit/schematics : 9.1.0 @angular/cli : 9.1.0 @ionic/angular-toolkit : 2.2.0 Utility: cordova-res : not installed native-run : not installed System: NodeJS : v12.16.1 (C:\Program Files\nodejs\node.exe) npm : 6.13.4 OS : Windows 10
Posts: 1
Participants: 1
@ehboym wrote:
HI,
when trying to import “service-worker” from @angular the module can not be found.
when I try toimport { ServiceWorkerModule } from '@angular/service-worker';
The system does not find the package.
Is there a special package I need to install to add “service-worker” to an exsisting angular/project ?
Thanks
When I run:
ng add @angular/pwa --project app
The result is:
Installing packages for tooling via npm. Installed packages for tooling via npm. ERROR! src/manifest.webmanifest already exists. ERROR! src/assets/icons/icon-128x128.png already exists. ERROR! src/assets/icons/icon-144x144.png already exists. ERROR! src/assets/icons/icon-152x152.png already exists. ERROR! src/assets/icons/icon-192x192.png already exists. ERROR! src/assets/icons/icon-512x512.png already exists. ERROR! src/assets/icons/icon-72x72.png already exists. The Schematic workflow failed. See above.
Ionic: Ionic CLI : 6.3.0 (C:\Users\user\AppData\Roaming\npm\node_modules\@ionic\cli) Ionic Framework : @ionic/angular 5.0.7 @angular-devkit/build-angular : 0.803.25 @angular-devkit/schematics : 9.1.0 @angular/cli : 9.1.0 @ionic/angular-toolkit : 2.2.0 Utility: cordova-res : not installed native-run : not installed System: NodeJS : v12.16.1 (C:\Program Files\nodejs\node.exe) npm : 6.13.4 OS : Windows 10
Package Current Wanted Latest Location @angular-devkit/build-angular 0.803.25 0.803.25 0.901.0 BLSProtocols_B @types/jasmine 3.3.16 3.3.16 3.5.10 BLSProtocols_B @types/node 8.9.5 8.9.5 13.9.5 BLSProtocols_B core-js 2.6.11 2.6.11 3.6.4 BLSProtocols_B jasmine-core 3.4.0 3.4.0 3.5.0 BLSProtocols_B jasmine-spec-reporter 4.2.1 4.2.1 5.0.1 BLSProtocols_B karma 4.1.0 4.1.0 4.4.1 BLSProtocols_B karma-chrome-launcher 2.2.0 2.2.0 3.1.0 BLSProtocols_B karma-coverage-istanbul-reporter 2.0.6 2.0.6 2.1.1 BLSProtocols_B karma-jasmine 2.0.1 2.0.1 3.1.1 BLSProtocols_B ts-node 7.0.1 7.0.1 8.8.1 BLSProtocols_B tslint 5.15.0 5.15.0 6.1.0 BLSProtocols_B
Posts: 1
Participants: 1
@Nats97 wrote:
I’m trying to use the
trash-outline
icon in my app, but there seems to be some error while fetching it
on my chrome console I get
zone-evergreen.js:1042 GET http://localhost:8100/svg/md-trash-outline.svg 404 (Not Found)
Before creating this thread, I double checked the spells and syntax. Can someone else please verify it.
Note: Filled icons works perfectly, but I need to use the outlined version which doesn’t works
Posts: 1
Participants: 1
@grallm wrote:
Hello, I come with a little question on a problem with which I’m struggling a bit
I currently have an app based on the React demo app and this App.tsx with some routes and my Menu, which is a component shared with all pages.
<IonApp> <IonReactRouter> <IonSplitPane contentId="main"> <Menu /> <IonRouterOutlet id="main"> <Route path="/home" component={HomePage} /> <Route path="/products" component={ProductPage} exact /> <Route path="/favorites" component={ProductPage} /> <Route render={(): JSX.Element => <Redirect to="/home" />} /> </IonRouterOutlet> </IonSplitPane> </IonReactRouter> </IonApp>
I know have aHeader
component present in all my pages in aIonPage
component but I would like it to not “refresh/reload” on each page changing, is it possible to add it in App.tsx to do this ?I also just read that
IonRouterOutlet
should only be used for Angular, is it true ? What should I do ?Thanks a lot.
Malo.
Posts: 1
Participants: 1
@media4learning wrote:
Simple question - I have Ionic v5.4.4. I need to create an Ionic 4 project. What is the cli command to do this? ionic start myapp blank --type=ionic4 ?? I cannot find any documentation around this.
Thanks!
Posts: 5
Participants: 2