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

Convert Ionic app to Angular app

$
0
0

@brianmackey wrote:

Ionic CLI 4.10.3.

We have 1 Ionic app. We need to break it into 3 apps. 2 Angular and 1 Ionic.

I read that Ionic does not directly support deployments as a website. I’m tasked with converting an Ionic app to an Angular app. Is this supported?

If no, my idea is to use Angular Material to get a similar look and feel. Has anyone done this? Any suggestions or recommendations?

Posts: 1

Participants: 1

Read full topic


Compiling problems with --prod

$
0
0

@Kyrax80 wrote:

Hello, if I compile my App with ionic cordova build android --prod I get an error in my console log saying the following:

Unhandled Promise rejection: StaticInjectorError(n)[t -> e]: 
  StaticInjectorError(Platform: core)[t -> e]: 
    NullInjectorError: No provider for e! ; Zone: <root> ; Task: Promise.then ; Value: Error: StaticInjectorError(n)[t -> e]: 
  StaticInjectorError(Platform: core)[t -> e]: 
    NullInjectorError: No provider for e!
    at t.get (vendor.js:1)
    at vendor.js:1
    at _ (vendor.js:1)
    at t.get (vendor.js:1)
    at vendor.js:1
    at _ (vendor.js:1)
    at t.get (vendor.js:1)
    at re (vendor.js:1)
    at t.get (vendor.js:1)
    at Te (vendor.js:1) Error: StaticInjectorError(n)[t -> e]: 
  StaticInjectorError(Platform: core)[t -> e]: 
    NullInjectorError: No provider for e!
    at t.get (file:///android_asset/www/build/vendor.js:1:58192)
    at file:///android_asset/www/build/vendor.js:1:10256
    at _ (file:///android_asset/www/build/vendor.js:1:10280)
    at t.get (file:///android_asset/www/build/vendor.js:1:58973)
    at file:///android_asset/www/build/vendor.js:1:10256
    at _ (file:///android_asset/www/build/vendor.js:1:10280)
    at t.get (file:///android_asset/www/build/vendor.js:1:58973)
    at re (file:///android_asset/www/build/vendor.js:1:25967)
    at t.get (file:///android_asset/www/build/vendor.js:1:108151)
    at Te (file:///android_asset/www/build/vendor.js:1:31315)

I’ve never needed to import Platform from ionic-angular to providers and this isn’t happening if I compile with --prod

My Ionic info is:

cli packages: (C:\...\node_modules)

    @ionic/cli-utils  : 1.19.3
    ionic (Ionic CLI) : 3.20.1

global packages:

    cordova (Cordova CLI) : 7.1.0

local packages:

    @ionic/app-scripts : 3.1.10
    Cordova Platforms  : android 6.3.0
    Ionic Framework    : ionic-angular 3.9.2

System:

    Android SDK Tools : 26.1.1
    Node              : v8.11.1
    npm               : 6.8.0
    OS                : Windows 10

Environment Variables:

    ANDROID_HOME : C:\Users\...\AppData\Local\Android\Sdk

Misc:

    backend : pro

What can be causing this?

Thanks

Posts: 1

Participants: 1

Read full topic

Ionic 4 ionic lab proxy not working

$
0
0

@ian4bis wrote:

I am upgrading a project from ionic 3 to ionic 4 and I am running into an issue with proxies in ionic lab. I have followed the guides to configure proxies for angular 7 and am able to get the proxied working with ionic serve and ng serve. But when I use ionic serve --lab, the lab environment is still submitting all api calls to localhost. Has anyone experienced this problem, or have any ideas on what could be wrong?

ionic info:

Ionic:

ionic (Ionic CLI) : 4.10.3
Ionic Framework : @ionic/angular 4.0.1
@angular-devkit/build-angular : 0.12.4
@angular-devkit/schematics : 7.2.4
@angular/cli : 7.2.4
@ionic/angular-toolkit : 1.4.0

angular.json:

“serve”: {
“builder”: “@angular-devkit/build-angular:dev-server”,
“options”: {
“browserTarget”: “app:build”,
“proxyConfig”: “proxy.conf.js”
},
“configurations”: {
“production”: {
“browserTarget”: “app:build:production”
},
“ci”: {
“progress”: false
}
}
}

proxy.conf.js:

const PROXY_CONFIG = [
{
context: [
“/api1”,
“/api2”,
“/api3”,
“/api4”,
“/api5”
],
target: “https://www.myURL.com”,
secure: true,
changeOrigin: true
}
]

module.exports = PROXY_CONFIG;

Posts: 1

Participants: 1

Read full topic

Logout facebook ionic 4

$
0
0

@Ludolefrenchy wrote:

Hello,
I have a little worry.
I followed this tutorial and my problem is that FB does not want to disconnect.
I get that in the console “FB.logout() called without an access token”

  logout() {
      this.fb.logout().then(res => {
      this.nativeStorage.remove('facebook_user');
      this.router.navigate(["/"]);
    }, err => {
      console.log(err);
    });
  }

I searched but I do not find how to disconnect if the user wishes.

thank you in advance

Ludo

Posts: 1

Participants: 1

Read full topic

Ionic 4 - popover component and lazy load

$
0
0

@badpenguin wrote:

  • usually i don’t need to declare other modules in app.module because those are lazy loaded by the router
  • however i’ve created a shared service provider that wrap popover.create to quickly create one
  • for some reason if i launch popoverController.create() from within this service it will not see my popover child component - it works of course if i run the code from within the page
  • i also tried passing a string instead of the object but its the same

Is there a way to force my popover component to be resolved before invoking the function in the service?

Posts: 1

Participants: 1

Read full topic

Translucent Tabs Ionic 4

$
0
0

@iaguilera14 wrote:

Has anyone been able to get the tab bar translucent on ionic 4? The following doesn’t seem to work. I have the header working as translucent. I have also set ion-content to fullscreen.

<ion-tab-bar slot="bottom" translucent="true">
  
</ion-tab-bar>

Posts: 1

Participants: 1

Read full topic

IOS Smart Punctuation (curly quotes)

$
0
0

@bitflinger wrote:

When using the ion-searchbar & searching for items containing an apostrophe, it returns no data when “smart punctuation” (ios 11 & above) is turned on. Is there a solution to this other than doing a string.replace() to replace curly quotes with straight quotes or telling the user to disable it in the ios general->keyboard->settings?

It would be nice if we had a variable to set for the app where we could enable/disable smart punctuation. Does anything like this exist?

Thanks,
Charlie

Posts: 1

Participants: 1

Read full topic

Origin is ionic:// not http://

$
0
0

@MSC29 wrote:

Hi,

anybody know why on my requests the Origin is ionic:// not http://?

I think that’s the reason why my firebase authentication requests fail…

Request
Connection: Upgrade
Host: xxxxxxx.firebaseio.com
Origin: ionic://localhost
Pragma: no-cache
Cache-Control: no-cache
Sec-WebSocket-Key: xx
Sec-WebSocket-Version: xx
Sec-WebSocket-Extensions: x-webkit-deflate-frame
User-Agent: Mozilla/5.0 Google

Here’s my config

Ionic:

   ionic (Ionic CLI)             : 4.10.3 (/usr/local/lib/node_modules/ionic)
   Ionic Framework               : @ionic/angular 4.0.2
   @angular-devkit/build-angular : 0.12.4
   @angular-devkit/schematics    : 7.2.4
   @angular/cli                  : 7.2.4
   @ionic/angular-toolkit        : 1.4.0

Cordova:

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

System:

   ios-deploy : 1.9.4
   ios-sim    : 7.0.0
   NodeJS     : v11.8.0 (/usr/local/bin/node)
   npm        : 6.5.0
   OS         : macOS Mojave
   Xcode      : Xcode 9.0 Build version 9A235

plugins

cordova-plugin-add-swift-support 1.7.2 "AddSwiftSupport"
cordova-plugin-app-event 1.2.1 "Application Events"
cordova-plugin-badge 0.8.8 "Badge"
cordova-plugin-browsertab 0.2.0 "cordova-plugin-browsertab"
cordova-plugin-compat 1.2.0 "Compat"
cordova-plugin-customurlscheme 4.3.0 "Custom URL scheme"
cordova-plugin-device 2.0.2 "Device"
cordova-plugin-inappbrowser 3.0.0 "InAppBrowser"
cordova-plugin-ionic 3.1.3 "IonicCordova"
cordova-plugin-ionic-keyboard 2.1.3 "cordova-plugin-ionic-keyboard"
cordova-plugin-ionic-webview 3.1.2 "cordova-plugin-ionic-webview"
cordova-plugin-local-notification 0.9.0-beta.2 "LocalNotification"
cordova-plugin-splashscreen 4.1.0 "Splashscreen"
cordova-plugin-statusbar 2.4.2 "StatusBar"
cordova-plugin-whitelist 1.3.3 "Whitelist"
cordova-sqlite-storage 3.1.0 "Cordova sqlite storage plugin - cordova-sqlite-storage plugin version"
cordova-universal-links-plugin 1.2.1 "Universal Links Plugin"

Thanks!

Posts: 1

Participants: 1

Read full topic


How can insert the data manually to the firebase?

$
0
0

@NoorAlhuda1990 wrote:

Hi friends , how can i insert some data to firebase manually ??? i mean i insert it to database and then i import it to my ionic 4 app

Posts: 1

Participants: 1

Read full topic

Downloading files in iOS

$
0
0

@aishukhanna wrote:

Hello,

I am trying to download an image in my app using native plugin File in iOS. , this is the code I am using for iOS version:

Typescript file:

let folderpath = null;
if (this.platform.is('ios')) {
            folderpath = this.file.dataDirectory;
        } else {
            folderpath = this.file.externalRootDirectory;
        }

        let filename = 'temp-image.png';
        
this.file.resolveLocalFilesystemUrl(folderpath).then((res) => {
            
            this.file.writeFile(folderpath, filename, DataBlob, {replace: true}).then((success) => {
                this.alertService.showPopup('Card successfully saved to image library', 'Save card success');
            }).catch((err) => {  
                this.alertService.showPopup('Unable to save file', 'Save card error');
            });
        }).catch((error) => {
            this.alertService.showPopup('Unable to save file', 'Save card error');
        })

In Config xml:

<preference name="iosPersistentFileLocation" value="Library">

File is successfully getting stored and I get the alert providing the message in the code. But I am unable to find this file anywhere in my device. Also, I can make the app access the file it stores(like read and output the file as a base64 encoded data url with readAsDataUrl).

Is there any approach to download the files in iOS? I appreciate your time on this.

Thanks

Posts: 1

Participants: 1

Read full topic

Ionic 4 - IonicNativePlugin wrapper for custom plugins Error: Object(...) is not a function

$
0
0

@AsPolar wrote:

I built a plugin then i create his wrapper for work with typescript, this code works on ionic 3 but i have this error on ionic 4

this is my ionic native wrapper for my custom plugin

  1. file-path: src/@ionic-native/plugins/signal-strenght/index.ts
import { Injectable } from '@angular/core';
import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core';

@Plugin({
    pluginName: 'SignalStrength',
    plugin: 'cordova-aspolar-plugin-signal-strength',
    pluginRef: 'window.plugins.signalStrength',
    repo: 'https://github.com/JVasconsueloM/aspolar-signal-strength',
    platforms: ['Android']
})
@Injectable()
export class SignalStrength extends IonicNativePlugin {

    @Cordova()
    getdBm(): Promise<any> { return; }

    @Cordova()
    getPercentage(): Promise<any> { return; }

    @Cordova()
    getLevel(): Promise<any> { return; }
}

  1. on app.module.ts
    Screenshot_3

  2. I get this error

Posts: 1

Participants: 1

Read full topic

Google+ Login (cordova-plugin-googleplus) alternative?

$
0
0

@salvatojalva wrote:

Hi guys, there’s any alternative of cordova-plugin-googleplus plugin?

Since google will not be longer avilable the login will fail, i tried search for alternatives but with no luck, please if you have any sugestion will be great.

Thank you!

Posts: 1

Participants: 1

Read full topic

Localhost http get error ionic v3

$
0
0

@akil27 wrote:

Anytime I make a get request to my server I am getting the error in the pic. I am getting the data as expected from my server and there is no problem. The thing is I am not even using localhost as my server. I don’t deal with localhost at all but still it seems ionic making a null request to the localhost. Does anybody know why this is?

Posts: 1

Participants: 1

Read full topic

Alternative to cordova-device-accounts?

$
0
0

@Llarian wrote:

Hi,

good evening every one.
I am looking for an alternative for the device-accounts plugin:


which is not maintained anymore and does not work. I need a way to get the current used account.

regards

Posts: 1

Participants: 1

Read full topic

Error AndroidPermissions

$
0
0

@jeffersonpereira wrote:

vendor.js:1823 ERROR Error: Uncaught (in promise): TypeError: Object(...) is not a function
TypeError: Object(...) is not a function
    at AndroidPermissions.checkPermission (vendor.js:60951)
    at ValidaSenhaPage.webpackJsonp.171.ValidaSenhaPage.requestAllPermissions (main.js:489)
    at new ValidaSenhaPage (main.js:481)
    at createClass (vendor.js:12865)
    at createDirectiveInstance (vendor.js:12700)
    at createViewNodes (vendor.js:14158)
    at createRootView (vendor.js:14047)
    at callWithDebugContext (vendor.js:15472)
    at Object.debugCreateRootView [as createRootView] (vendor.js:14755)
    at ComponentFactory_.create (vendor.js:11652)
    at AndroidPermissions.checkPermission (vendor.js:60951)
    at ValidaSenhaPage.webpackJsonp.171.ValidaSenhaPage.requestAllPermissions (main.js:489)
    at new ValidaSenhaPage (main.js:481)
    at createClass (vendor.js:12865)
    at createDirectiveInstance (vendor.js:12700)
    at createViewNodes (vendor.js:14158)
    at createRootView (vendor.js:14047)
    at callWithDebugContext (vendor.js:15472)
    at Object.debugCreateRootView [as createRootView] (vendor.js:14755)
    at ComponentFactory_.create (vendor.js:11652)
    at c (polyfills.js:3)
    at Object.reject (polyfills.js:3)
    at OverlayPortal.NavControllerBase._fireError (vendor.js:54530)
    at OverlayPortal.NavControllerBase._failed (vendor.js:54523)
    at vendor.js:54570
    at t.invoke (polyfills.js:3)
    at Object.onInvoke (vendor.js:5134)
    at t.invoke (polyfills.js:3)
    at r.run (polyfills.js:3)
    at polyfills.js:3

​```

Posts: 1

Participants: 1

Read full topic


Ionic 4: Display Alert Before App goes to background

Ionic 2: How to show second dropdown data based on previous dropdown selection in ionic 2 with json

$
0
0

@aseelali23 wrote:

I have a registration page in which i have 3 combobox. One contains country names, second one contains state and third one contains district.so when i select a country corresponding state should come, and when i select state corresponding district should come. I have json contaiing districts and states which in file location assets/data/region.js How can i do this? Pls help.

html file

        <ion-header>
    <ion-navbar>
        <ion-title>Location Information</ion-title>
    </ion-navbar>
   </ion-header>

    <ion-content>
    <h1 class="h1">Location</h1>

    <ion-row>
        <ion-col>
            <ion-label>Country Living in:</ion-label>
        </ion-col>
    </ion-row>
    <ion-row>
        <ion-col>
            <ion-select  placeholder="Select">
                <ion-option [value]="sCountry" >India</ion-option>
            </ion-select>
        </ion-col>
    </ion-row>
    <ion-row>
        <ion-col>
            <ion-label>Residing State:</ion-label>
        </ion-col>
        <ion-col>
            <ion-label>Residing City/District:</ion-label>
        </ion-col>
    </ion-row>
    <ion-row>
        <ion-col >
            <ion-select  [(ngModel)]="sState" placeholder="Select">
                <ion-option [value]="state"></ion-option>
            </ion-select>
        </ion-col>
        <ion-col >
            <ion-select  [(ngModel)]="sDistrict" placeholder="Select">
                <ion-option [value]="districts"></ion-option>
            </ion-select>
        </ion-col>
    </ion-row>
    <ion-row>
            <ion-col>
                <button ion-button full color="secondary" block>Save</button>
            </ion-col>
            <ion-col>
                <button (click)="nxt()" ion-button full color="primary" block>Next</button>
            </ion-col>
        </ion-row>
       </ion-content>

ts file

      import { Component } from '@angular/core'; 
      import { NavController, AlertController, LoadingController, Loading, IonicPage } from 'ionic- 
      angular';
      import { ObsAuthService } from '../../services/obs_auth.services';
      import { MatriproPage } from '../matripro/matripro';
     import { LocationService } from '../../services/loc.service';

    @Component({
    selector: 'page-matriloc',
    templateUrl: 'matriloc.html',
    
    providers: [ObsAuthService]
    
     })
    export class MatrilocPage{
   
    
    constructor(private nav: NavController, private auth: ObsAuthService,
        private alertCtrl: AlertController, private loadingCtrl: LoadingController,
        private myService: LocationService) {
        }

    selectChange(e) {
        console.log(e);
    }  
    
    public nxt(){
        this.nav.push(MatriproPage);
        
    }
    goback() {
             this.nav.pop();
     }
     }

region.js json file

{  
    "states":[  
       {  
          "state":"Andhra Pradesh",
          "districts":[  
             "Anantapur",
             "Chittoor",
             "East Godavari",
             "Guntur",
             "Krishna",
             "Kurnool",
             "Nellore",
             "Prakasam",
             "Srikakulam",
             "Visakhapatnam",
             "Vizianagaram",
             "West Godavari",
             "YSR Kadapa"
          ]
       },
       {  
          "state":"Arunachal Pradesh",
          "districts":[  
             "Tawang",
             "West Kameng",
             "East Kameng",
             "Papum Pare",
             "Kurung Kumey",
             "Kra Daadi",
             "Lower Subansiri",
             "Upper Subansiri",
             "West Siang",
             "East Siang",
             "Siang",
             "Upper Siang",
             "Lower Siang",
             "Lower Dibang Valley",
             "Dibang Valley",
             "Anjaw",
             "Lohit",
             "Namsai",
             "Changlang",
             "Tirap",
             "Longding"
          ]
       },
       {  
          "state":"Assam",
          "districts":[  
             "Baksa",
             "Barpeta",
             "Biswanath",
             "Bongaigaon",
             "Cachar",
             "Charaideo",
             "Chirang",
             "Darrang",
             "Dhemaji",
             "Dhubri",
             "Dibrugarh",
             "Goalpara",
             "Golaghat",
             "Hailakandi",
             "Hojai",
             "Jorhat",
             "Kamrup Metropolitan",
             "Kamrup",
             "Karbi Anglong",
             "Karimganj",
             "Kokrajhar",
             "Lakhimpur",
             "Majuli",
             "Morigaon",
             "Nagaon",
             "Nalbari",
             "Dima Hasao",
             "Sivasagar",
             "Sonitpur",
             "South Salmara-Mankachar",
             "Tinsukia",
             "Udalguri",
             "West Karbi Anglong"
          ]
       },
       {  
          "state":"Bihar",
          "districts":[  
             "Araria",
             "Arwal",
             "Aurangabad",
             "Banka",
             "Begusarai",
             "Bhagalpur",
             "Bhojpur",
             "Buxar",
             "Darbhanga",
             "East Champaran (Motihari)",
             "Gaya",
             "Gopalganj",
             "Jamui",
             "Jehanabad",
             "Kaimur (Bhabua)",
             "Katihar",
             "Khagaria",
             "Kishanganj",
             "Lakhisarai",
             "Madhepura",
             "Madhubani",
             "Munger (Monghyr)",
             "Muzaffarpur",
             "Nalanda",
             "Nawada",
             "Patna",
             "Purnia (Purnea)",
             "Rohtas",
             "Saharsa",
             "Samastipur",
             "Saran",
             "Sheikhpura",
             "Sheohar",
             "Sitamarhi",
             "Siwan",
             "Supaul",
             "Vaishali",
             "West Champaran"
          ]
       },
       {  
          "state":"Chandigarh (UT)",
          "districts":[  
             "Chandigarh"
          ]
       },
       {  
          "state":"Chhattisgarh",
          "districts":[  
             "Balod",
             "Baloda Bazar",
             "Balrampur",
             "Bastar",
             "Bemetara",
             "Bijapur",
             "Bilaspur",
             "Dantewada (South Bastar)",
             "Dhamtari",
             "Durg",
             "Gariyaband",
             "Janjgir-Champa",
             "Jashpur",
             "Kabirdham (Kawardha)",
             "Kanker (North Bastar)",
             "Kondagaon",
             "Korba",
             "Korea (Koriya)",
             "Mahasamund",
             "Mungeli",
             "Narayanpur",
             "Raigarh",
             "Raipur",
             "Rajnandgaon",
             "Sukma",
             "Surajpur  ",
             "Surguja"
          ]
       },
       {  
          "state":"Dadra and Nagar Haveli (UT)",
          "districts":[  
             "Dadra & Nagar Haveli"
          ]
       },
       {  
          "state":"Daman and Diu (UT)",
          "districts":[  
             "Daman",
             "Diu"
          ]
       },
       {  
          "state":"Delhi (NCT)",
          "districts":[  
             "Central Delhi",
             "East Delhi",
             "New Delhi",
             "North Delhi",
             "North East  Delhi",
             "North West  Delhi",
             "Shahdara",
             "South Delhi",
             "South East Delhi",
             "South West  Delhi",
             "West Delhi"
          ]
       },
       {  
          "state":"Goa",
          "districts":[  
             "North Goa",
             "South Goa"
          ]
       },
       {  
          "state":"Gujarat",
          "districts":[  
             "Ahmedabad",
             "Amreli",
             "Anand",
             "Aravalli",
             "Banaskantha (Palanpur)",
             "Bharuch",
             "Bhavnagar",
             "Botad",
             "Chhota Udepur",
             "Dahod",
             "Dangs (Ahwa)",
             "Devbhoomi Dwarka",
             "Gandhinagar",
             "Gir Somnath",
             "Jamnagar",
             "Junagadh",
             "Kachchh",
             "Kheda (Nadiad)",
             "Mahisagar",
             "Mehsana",
             "Morbi",
             "Narmada (Rajpipla)",
             "Navsari",
             "Panchmahal (Godhra)",
             "Patan",
             "Porbandar",
             "Rajkot",
             "Sabarkantha (Himmatnagar)",
             "Surat",
             "Surendranagar",
             "Tapi (Vyara)",
             "Vadodara",
             "Valsad"
          ]
       },
       {  
          "state":"Haryana",
          "districts":[  
             "Ambala",
             "Bhiwani",
             "Charkhi Dadri",
             "Faridabad",
             "Fatehabad",
             "Gurgaon",
             "Hisar",
             "Jhajjar",
             "Jind",
             "Kaithal",
             "Karnal",
             "Kurukshetra",
             "Mahendragarh",
             "Mewat",
             "Palwal",
             "Panchkula",
             "Panipat",
             "Rewari",
             "Rohtak",
             "Sirsa",
             "Sonipat",
             "Yamunanagar"
          ]
       },
       {  
          "state":"Himachal Pradesh",
          "districts":[  
             "Bilaspur",
             "Chamba",
             "Hamirpur",
             "Kangra",
             "Kinnaur",
             "Kullu",
             "Lahaul &amp; Spiti",
             "Mandi",
             "Shimla",
             "Sirmaur (Sirmour)",
             "Solan",
             "Una"
          ]
       },
       {  
          "state":"Jammu and Kashmir",
          "districts":[  
             "Anantnag",
             "Bandipore",
             "Baramulla",
             "Budgam",
             "Doda",
             "Ganderbal",
             "Jammu",
             "Kargil",
             "Kathua",
             "Kishtwar",
             "Kulgam",
             "Kupwara",
             "Leh",
             "Poonch",
             "Pulwama",
             "Rajouri",
             "Ramban",
             "Reasi",
             "Samba",
             "Shopian",
             "Srinagar",
             "Udhampur"
          ]
       },
       {  
          "state":"Jharkhand",
          "districts":[  
             "Bokaro",
             "Chatra",
             "Deoghar",
             "Dhanbad",
             "Dumka",
             "East Singhbhum",
             "Garhwa",
             "Giridih",
             "Godda",
             "Gumla",
             "Hazaribag",
             "Jamtara",
             "Khunti",
             "Koderma",
             "Latehar",
             "Lohardaga",
             "Pakur",
             "Palamu",
             "Ramgarh",
             "Ranchi",
             "Sahibganj",
             "Seraikela-Kharsawan",
             "Simdega",
             "West Singhbhum"
          ]
       },
       {  
          "state":"Karnataka",
          "districts":[  
             "Bagalkot",
             "Ballari (Bellary)",
             "Belagavi (Belgaum)",
             "Bengaluru (Bangalore) Rural",
             "Bengaluru (Bangalore) Urban",
             "Bidar",
             "Chamarajanagar",
             "Chikballapur",
             "Chikkamagaluru (Chikmagalur)",
             "Chitradurga",
             "Dakshina Kannada",
             "Davangere",
             "Dharwad",
             "Gadag",
             "Hassan",
             "Haveri",
             "Kalaburagi (Gulbarga)",
             "Kodagu",
             "Kolar",
             "Koppal",
             "Mandya",
             "Mysuru (Mysore)",
             "Raichur",
             "Ramanagara",
             "Shivamogga (Shimoga)",
             "Tumakuru (Tumkur)",
             "Udupi",
             "Uttara Kannada (Karwar)",
             "Vijayapura (Bijapur)",
             "Yadgir"
          ]
       },
       {  
          "state":"Kerala",
          "districts":[  
             "Alappuzha",
             "Ernakulam",
             "Idukki",
             "Kannur",
             "Kasaragod",
             "Kollam",
             "Kottayam",
             "Kozhikode",
             "Malappuram",
             "Palakkad",
             "Pathanamthitta",
             "Thiruvananthapuram",
             "Thrissur",
             "Wayanad"
          ]
       },
       {  
          "state":"Lakshadweep (UT)",
          "districts":[  
             "Agatti",
             "Amini",
             "Androth",
             "Bithra",
             "Chethlath",
             "Kavaratti",
             "Kadmath",
             "Kalpeni",
             "Kilthan",
             "Minicoy"
          ]
       },
       {  
          "state":"Madhya Pradesh",
          "districts":[  
             "Agar Malwa",
             "Alirajpur",
             "Anuppur",
             "Ashoknagar",
             "Balaghat",
             "Barwani",
             "Betul",
             "Bhind",
             "Bhopal",
             "Burhanpur",
             "Chhatarpur",
             "Chhindwara",
             "Damoh",
             "Datia",
             "Dewas",
             "Dhar",
             "Dindori",
             "Guna",
             "Gwalior",
             "Harda",
             "Hoshangabad",
             "Indore",
             "Jabalpur",
             "Jhabua",
             "Katni",
             "Khandwa",
             "Khargone",
             "Mandla",
             "Mandsaur",
             "Morena",
             "Narsinghpur",
             "Neemuch",
             "Panna",
             "Raisen",
             "Rajgarh",
             "Ratlam",
             "Rewa",
             "Sagar",
             "Satna",
             "Sehore",
             "Seoni",
             "Shahdol",
             "Shajapur",
             "Sheopur",
             "Shivpuri",
             "Sidhi",
             "Singrauli",
             "Tikamgarh",
             "Ujjain",
             "Umaria",
             "Vidisha"
          ]
       },
       {  
          "state":"Maharashtra",
          "districts":[  
             "Ahmednagar",
             "Akola",
             "Amravati",
             "Aurangabad",
             "Beed",
             "Bhandara",
             "Buldhana",
             "Chandrapur",
             "Dhule",
             "Gadchiroli",
             "Gondia",
             "Hingoli",
             "Jalgaon",
             "Jalna",
             "Kolhapur",
             "Latur",
             "Mumbai City",
             "Mumbai Suburban",
             "Nagpur",
             "Nanded",
             "Nandurbar",
             "Nashik",
             "Osmanabad",
             "Palghar",
             "Parbhani",
             "Pune",
             "Raigad",
             "Ratnagiri",
             "Sangli",
             "Satara",
             "Sindhudurg",
             "Solapur",
             "Thane",
             "Wardha",
             "Washim",
             "Yavatmal"
          ]
       },
       {  
          "state":"Manipur",
          "districts":[  
             "Bishnupur",
             "Chandel",
             "Churachandpur",
             "Imphal East",
             "Imphal West",
             "Jiribam",
             "Kakching",
             "Kamjong",
             "Kangpokpi",
             "Noney",
             "Pherzawl",
             "Senapati",
             "Tamenglong",
             "Tengnoupal",
             "Thoubal",
             "Ukhrul"
          ]
       },
       {  
          "state":"Meghalaya",
          "districts":[  
             "East Garo Hills",
             "East Jaintia Hills",
             "East Khasi Hills",
             "North Garo Hills",
             "Ri Bhoi",
             "South Garo Hills",
             "South West Garo Hills ",
             "South West Khasi Hills",
             "West Garo Hills",
             "West Jaintia Hills",
             "West Khasi Hills"
          ]
       },
       {  
          "state":"Mizoram",
          "districts":[  
             "Aizawl",
             "Champhai",
             "Kolasib",
             "Lawngtlai",
             "Lunglei",
             "Mamit",
             "Saiha",
             "Serchhip"
          ]
       },
       {  
          "state":"Nagaland",
          "districts":[  
             "Dimapur",
             "Kiphire",
             "Kohima",
             "Longleng",
             "Mokokchung",
             "Mon",
             "Peren",
             "Phek",
             "Tuensang",
             "Wokha",
             "Zunheboto"
          ]
       },
       {  
          "state":"Odisha",
          "districts":[  
             "Angul",
             "Balangir",
             "Balasore",
             "Bargarh",
             "Bhadrak",
             "Boudh",
             "Cuttack",
             "Deogarh",
             "Dhenkanal",
             "Gajapati",
             "Ganjam",
             "Jagatsinghapur",
             "Jajpur",
             "Jharsuguda",
             "Kalahandi",
             "Kandhamal",
             "Kendrapara",
             "Kendujhar (Keonjhar)",
             "Khordha",
             "Koraput",
             "Malkangiri",
             "Mayurbhanj",
             "Nabarangpur",
             "Nayagarh",
             "Nuapada",
             "Puri",
             "Rayagada",
             "Sambalpur",
             "Sonepur",
             "Sundargarh"
          ]
       },
       {  
          "state":"Puducherry (UT)",
          "districts":[  
             "Karaikal",
             "Mahe",
             "Pondicherry",
             "Yanam"
          ]
       },
       {  
          "state":"Punjab",
          "districts":[  
             "Amritsar",
             "Barnala",
             "Bathinda",
             "Faridkot",
             "Fatehgarh Sahib",
             "Fazilka",
             "Ferozepur",
             "Gurdaspur",
             "Hoshiarpur",
             "Jalandhar",
             "Kapurthala",
             "Ludhiana",
             "Mansa",
             "Moga",
             "Muktsar",
             "Nawanshahr (Shahid Bhagat Singh Nagar)",
             "Pathankot",
             "Patiala",
             "Rupnagar",
             "Sahibzada Ajit Singh Nagar (Mohali)",
             "Sangrur",
             "Tarn Taran"
          ]
       },
       {  
          "state":"Rajasthan",
          "districts":[  
             "Ajmer",
             "Alwar",
             "Banswara",
             "Baran",
             "Barmer",
             "Bharatpur",
             "Bhilwara",
             "Bikaner",
             "Bundi",
             "Chittorgarh",
             "Churu",
             "Dausa",
             "Dholpur",
             "Dungarpur",
             "Hanumangarh",
             "Jaipur",
             "Jaisalmer",
             "Jalore",
             "Jhalawar",
             "Jhunjhunu",
             "Jodhpur",
             "Karauli",
             "Kota",
             "Nagaur",
             "Pali",
             "Pratapgarh",
             "Rajsamand",
             "Sawai Madhopur",
             "Sikar",
             "Sirohi",
             "Sri Ganganagar",
             "Tonk",
             "Udaipur"
          ]
       },
       {  
          "state":"Sikkim",
          "districts":[  
             "East Sikkim",
             "North Sikkim",
             "South Sikkim",
             "West Sikkim"
          ]
       },
       {  
          "state":"Tamil Nadu",
          "districts":[  
             "Ariyalur",
             "Chennai",
             "Coimbatore",
             "Cuddalore",
             "Dharmapuri",
             "Dindigul",
             "Erode",
             "Kanchipuram",
             "Kanyakumari",
             "Karur",
             "Krishnagiri",
             "Madurai",
             "Nagapattinam",
             "Namakkal",
             "Nilgiris",
             "Perambalur",
             "Pudukkottai",
             "Ramanathapuram",
             "Salem",
             "Sivaganga",
             "Thanjavur",
             "Theni",
             "Thoothukudi (Tuticorin)",
             "Tiruchirappalli",
             "Tirunelveli",
             "Tiruppur",
             "Tiruvallur",
             "Tiruvannamalai",
             "Tiruvarur",
             "Vellore",
             "Viluppuram",
             "Virudhunagar"
          ]
       },
       {  
          "state":"Telangana",
          "districts":[  
             "Adilabad",
             "Bhadradri Kothagudem",
             "Hyderabad",
             "Jagtial",
             "Jangaon",
             "Jayashankar Bhoopalpally",
             "Jogulamba Gadwal",
             "Kamareddy",
             "Karimnagar",
             "Khammam",
             "Komaram Bheem Asifabad",
             "Mahabubabad",
             "Mahabubnagar",
             "Mancherial",
             "Medak",
             "Medchal",
             "Nagarkurnool",
             "Nalgonda",
             "Nirmal",
             "Nizamabad",
             "Peddapalli",
             "Rajanna Sircilla",
             "Rangareddy",
             "Sangareddy",
             "Siddipet",
             "Suryapet",
             "Vikarabad",
             "Wanaparthy",
             "Warangal (Rural)",
             "Warangal (Urban)",
             "Yadadri Bhuvanagiri"
          ]
       },
       {  
          "state":"Tripura",
          "districts":[  
             "Dhalai",
             "Gomati",
             "Khowai",
             "North Tripura",
             "Sepahijala",
             "South Tripura",
             "Unakoti",
             "West Tripura"
          ]
       },
       {  
          "state":"Uttarakhand",
          "districts":[  
             "Almora",
             "Bageshwar",
             "Chamoli",
             "Champawat",
             "Dehradun",
             "Haridwar",
             "Nainital",
             "Pauri Garhwal",
             "Pithoragarh",
             "Rudraprayag",
             "Tehri Garhwal",
             "Udham Singh Nagar",
             "Uttarkashi"
          ]
       },
       {  
          "state":"Uttar Pradesh",
          "districts":[  
             "Agra",
             "Aligarh",
             "Allahabad",
             "Ambedkar Nagar",
             "Amethi (Chatrapati Sahuji Mahraj Nagar)",
             "Amroha (J.P. Nagar)",
             "Auraiya",
             "Azamgarh",
             "Baghpat",
             "Bahraich",
             "Ballia",
             "Balrampur",
             "Banda",
             "Barabanki",
             "Bareilly",
             "Basti",
             "Bhadohi",
             "Bijnor",
             "Budaun",
             "Bulandshahr",
             "Chandauli",
             "Chitrakoot",
             "Deoria",
             "Etah",
             "Etawah",
             "Faizabad",
             "Farrukhabad",
             "Fatehpur",
             "Firozabad",
             "Gautam Buddha Nagar",
             "Ghaziabad",
             "Ghazipur",
             "Gonda",
             "Gorakhpur",
             "Hamirpur",
             "Hapur (Panchsheel Nagar)",
             "Hardoi",
             "Hathras",
             "Jalaun",
             "Jaunpur",
             "Jhansi",
             "Kannauj",
             "Kanpur Dehat",
             "Kanpur Nagar",
             "Kanshiram Nagar (Kasganj)",
             "Kaushambi",
             "Kushinagar (Padrauna)",
             "Lakhimpur - Kheri",
             "Lalitpur",
             "Lucknow",
             "Maharajganj",
             "Mahoba",
             "Mainpuri",
             "Mathura",
             "Mau",
             "Meerut",
             "Mirzapur",
             "Moradabad",
             "Muzaffarnagar",
             "Pilibhit",
             "Pratapgarh",
             "RaeBareli",
             "Rampur",
             "Saharanpur",
             "Sambhal (Bhim Nagar)",
             "Sant Kabir Nagar",
             "Shahjahanpur",
             "Shamali (Prabuddh Nagar)",
             "Shravasti",
             "Siddharth Nagar",
             "Sitapur",
             "Sonbhadra",
             "Sultanpur",
             "Unnao",
             "Varanasi"
          ]
       },
       {  
          "state":"West Bengal",
          "districts":[  
             "Alipurduar",
             "Bankura",
             "Birbhum",
             "Burdwan (Bardhaman)",
             "Cooch Behar",
             "Dakshin Dinajpur (South Dinajpur)",
             "Darjeeling",
             "Hooghly",
             "Howrah",
             "Jalpaiguri",
             "Kalimpong",
             "Kolkata",
             "Malda",
             "Murshidabad",
             "Nadia",
             "North 24 Parganas",
             "Paschim Medinipur (West Medinipur)",
             "Purba Medinipur (East Medinipur)",
             "Purulia",
             "South 24 Parganas",
             "Uttar Dinajpur (North Dinajpur)"
          ]
       }
    ]
 }

Posts: 2

Participants: 1

Read full topic

How to edit the content of the page using a modal page

$
0
0

@neenu123 wrote:

I have a subscription page consist of 3 cards, in which on selecting each card a button is enabled. This button is used to edit or add items to the page. When the button is clicked it will redirect to a modal page which consist of text fields. By clicking the close button in modal page the subscription page is automated to new contents which is given in the modal page. I am new in ionic so please help me with the full code to edit the items in the page.

subscription html



  <ion-header>
    <ion-navbar>
        <ion-title>SUBSCRIPTION</ion-title>
    </ion-navbar>
</ion-header>

<ion-content>
    <ion-item>
        <ion-buttons end>
            <button ion-button [disabled]="!isenabled" class="add_buttn" (click)="openModal({charNum: 0})">Add/Edit</button>
        </ion-buttons>
    </ion-item>
    <ion-label class="sentnc">Take your desired plan to get access to our content easily</ion-label>
    <ion-grid>
        <ion-row>
            <ion-col col-4 *ngFor="let sub of subLst">
                <ion-card (click)="onCardClick()">
                    <div *ngIf="cardClicked"></div>
                    <ion-card-content>
                        <ion-card-title class="titles">
                            {{sub.name}}
                        </ion-card-title>
                        <p>{{sub.plan}}</p>
                        <p>&nbsp;</p>
                        <p class="cost">₹{{sub.amount}}</p>
                        <p>&nbsp;</p>
                        <p>
                            <button  (click)="free_pay(option)" ion-button color="dark" round>Choose plan</button>
                        </p>
                    </ion-card-content>
                </ion-card>
            </ion-col>
        </ion-row>
    </ion-grid>
  </ion-content>


subscription ts page



import { Component } from '@angular/core';
import { NavController, NavParams, AlertController, LoadingController, Loading, IonicPage, Checkbox } from 'ionic-angular';
import { ObsAuthService } from '../../services/obs_auth.services';
import { ModalController, Platform, ViewController } from 'ionic-angular';
import { JobsearchPage } from '../jobsearch/jobsearch';
import { ConnectpayPage } from '../connectpay/connectpay';
import { AdminsubPage } from '../adminsub/adminsub';


@Component({
    selector: 'page-jobsub',
    templateUrl: 'jobsub.html',
    providers: [ObsAuthService]
})


export class JobsubPage {

    public isPayValid:boolean = false;

    jobseacrchPage:JobsearchPage;
    connectpayPage:ConnectpayPage;
    public category: string = "CLASSIC";
    public subscription: string = "PREMIUM";
    // public option: string = "";
    public opt:boolean=false;
    public cardClicked: boolean = false;
    isenabled: boolean = false;
    subLst: any = [{
        name: "Free",
        plan: "1 Month",
        discount: false,
        amount: 0,
        opt: true

    }, {
        name: "Classic",
        plan: "6 month",
        discount: false,
        amount: 100,
        opt: false

    }, {
        name: "Premium",
        plan: "1 Year",
        discount: false,
        amount: 200,
        opt: false

    }]
  

    constructor(private nav: NavController, private auth: ObsAuthService,
        private alertCtrl: AlertController, private loadingCtrl: LoadingController,
        public navParams: NavParams, public modalCtrl: ModalController) {
        // this.navParams.get('userParams');
    }

    openModal(characterNum) {

        let modal = this.modalCtrl.create(AdminsubPage, characterNum);
        modal.onDidDismiss(data => {
            // if (data != undefined) {
            //     this.subLst = data;

            // }
            console.log(data);
        });
        modal.present();
    }


    selectChange(e) {
        console.log(e);
    }

    //redirect to job search page
    public free_pay() {
      
        if(this.validate()){
            this.nav.push(JobsearchPage);
        }
        else{
            this.nav.push(ConnectpayPage);
        }
   
}

   
   
    //to enable the edit button
    public onCardClick() {
        this.cardClicked = !this.cardClicked;
        this.isenabled = true;
     
    }
   
    validate():boolean{
        if(this.opt==true){

            this.isPayValid=true;
        }
        else{
            this.isPayValid=false;
        }
        return this.isPayValid;

    }
}


modal html page


<ion-header>
    <ion-toolbar>
        <ion-title>
            Edit
        </ion-title>
        <ion-buttons end>
            <button ion-button (click)="closeModal()">Close</button>
        </ion-buttons>
    </ion-toolbar>
</ion-header>

<ion-content>
    <ion-col>
        <ion-row>
            <ion-item>
                <ion-label fixed>Title</ion-label>
                <ion-input type="text" value="">{{character.name}}</ion-input>
            </ion-item>
        </ion-row>
        <ion-item>
            <ion-label fixed>Plan</ion-label>
            <ion-input type="text" value="">{{character.plan}}</ion-input>
        </ion-item>
        <ion-item>
            <ion-label fixed>Amount</ion-label>
            <ion-input type="text" value="">{{character.amount}}</ion-input>
        </ion-item>
    </ion-col>
</ion-content>

modal ts page



import { Component } from '@angular/core';
import { NavController, AlertController, LoadingController, Loading, IonicPage } from 'ionic-angular';
import { Platform, NavParams, ViewController } from 'ionic-angular';
import { ObsAuthService } from '../../services/obs_auth.services';
import { ToastController } from 'ionic-angular';


@Component({
    selector: 'page-adminsub',
    templateUrl: 'adminsub.html',
    providers: [ObsAuthService]
})

export class AdminsubPage {
    character;
     data;

    constructor(private nav: NavController, private auth: ObsAuthService,
        private alertCtrl: AlertController, private loadingCtrl: LoadingController,
        public toastCtrl: ToastController, public platform: Platform,
        public params: NavParams,
        public viewCtrl: ViewController) {

        var characters = [
            {

                name: String,
                plan: String,
                amount: Number,
                // items: [
                //     { title: 'Race', note: 'Hobbit' },
                //     { title: 'Culture', note: 'River Folk' },
                //     { title: 'Alter Ego', note: 'Smeagol' }
                // ]
            }
        ];
        this.character = characters[this.params.get('charNum')];
    }
    public closeModal() {
        // let data = { 'foo': 'bar' };
        this.viewCtrl.dismiss(this.character);
    }

    selectChange(e) {
        console.log(e);
    }

}


Posts: 1

Participants: 1

Read full topic

Suddenly data is come "" from server there is any issue in my code?

$
0
0

@vishalkumargupta wrote:

data: " " headers: {"": “”} status: 200 url: “some url here” status is ok but data is come blank from some time ago , previously it is working fine. there is any solution for this.

Posts: 1

Participants: 1

Read full topic

[Ionic 4] ion-menu side="start" not working correctly in RTL mode?

$
0
0

@sndwav wrote:

I’m trying to have the ion-menu slide in from the correct side in LTR and RTL.

Relevant code:

$app-direction: multi;
direction: rtl;

<ion-menu side="start">

But the menu always slide in from the left.

Am I doing something wrong or is there an issue with RTL support in Ionic 4?

Thanks for any help!

Posts: 1

Participants: 1

Read full topic

Viewing all 48981 articles
Browse latest View live


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