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

Why this.menu.enable(true, 'loggedinMenu') not working in my case

$
0
0

@lolaswift1 wrote:

I am building my own app by learning from the ionic conference app"

I am trying like this:
constructor() {
this.menu.enable(true, ‘loggedInMenu’);
console.log(this.menu)
}
But the menu with id “loggedInMenu” isn’t enabled. Sorry that I can’t paste my complete code here. Maybe someone happen to know why it doesn’t work

Posts: 4

Participants: 2

Read full topic


No 'Access-Control-Allow-Origin' header is present on the requested resource - WP REST API

$
0
0

@marija06 wrote:

I am building an app using ionic, WP rest api and everything worked fine.

I am using http post, get, put and they all work fine with WP rest api. I installed Push Notifications for Wordpress Lite plugin which I a managed to setup and actually receive a notification but when I try to receive or send data to plugin with http post and get methods I receive No ‘Access-Control-Allow-Origin’ header is present on the requested resource error. This is the example from plugin documentation - GET /pnfw/posts/?token=device_id&os=iOS

It is really strange that WP rest api works and the plugin doesn’t since they are both on the same domain.

I have no idea what should I do to fix this so I hope someone here has an idea what might be causing this.

Posts: 5

Participants: 2

Read full topic

About CLI command

$
0
0

@bakabdel wrote:

what differnet between command: “ionic serve” and “npg ionic run ionic:serve” it’s same ? thank you.

Posts: 1

Participants: 1

Read full topic

Custom fonts won't render on Android

Ionic Crashing On Samsung

$
0
0

@gmeikle wrote:

I have developed an app using ionic that works seems to work on all modern phones except Samsung.
This is not an android issue as the same version works as long as the phone is not a Samsung.
I am using Ionic http, and believe I have CORS set up correctly.
However the app crashes when opened.
If anyone has experienced Samsung specific issues with ionic I would love to get to the bottom of this.

Posts: 1

Participants: 1

Read full topic

ReferenceError: cordova is not defined when ionic cordova run android --device -lcs

$
0
0

@kentoj wrote:

Is cordova supposed to be available when running on an Android device from the command line? Maybe I am missing something here.

My barcode scanner plugin works just fine when I deploy the APK to the device yet when I run
ionic cordova run android --device -lcs
I get ReferencError: cordova is not defined

Posts: 1

Participants: 1

Read full topic

Project augmented reality

$
0
0

@Cj10 wrote:

Good night
It was proposed to me a project where it was worked with augmented reality.
The idea is basically that the app identifies a product and when recognizing information about that product appears in the app.
Is there a tutorial where I can initialize this project?

Posts: 1

Participants: 1

Read full topic

Pass data from one page to another and update simultaneously

$
0
0

@mandersm8 wrote:

Hi, I am trying to make a button that dynamically changes the font size of an app. My button works for my current page but i’m trying to update other pages as well. I tried passing the data but that doesn’t seem to be working. Can someone please suggest a solution. Thanks in advance!

Settings.html

<!--
  Generated template for the SettingsPage page.

  See http://ionicframework.com/docs/components/#navigation for more info on
  Ionic pages and navigation.

Settings.html
-->
<ion-header>

  <ion-navbar>
    <ion-title>Settings</ion-title>
  </ion-navbar>

</ion-header>

<ion-content padding [ngStyle]="{'font-size': fontSize+'em' }" id="page">
  <div id="fonttable">
    <p>Choose a Font Size</p>

    <ion-buttons>
      <button (click)="fontSizeChange(-0.2)" ion-button icon-only>
        <ion-icon name="remove"></ion-icon>
      </button>
      <button (click)="fontSizeChange(0.2)" ion-button icon-only>
        <ion-icon name="add"></ion-icon>
      </button>
    </ion-buttons>
  </div>
</ion-content>

Settings.ts

import { Component } from '@angular/core';
import {App, IonicPage, NavController} from 'ionic-angular';
import { SettingsProvider } from './../../providers/settings/settings';
import {StudentHomePage} from "../StudentHome/StudentHome";

/**
 * Generated class for the SettingsPage page.
 *
 * See https://ionicframework.com/docs/components/#navigation for more info on
 * Ionic pages and navigation.
 */

@IonicPage()
@Component({
  selector: 'page-StudentSettigns',
  templateUrl: 'StudentSettigns.html',
})
export class StudentSettignsPage {

  constructor(public navCtrl: NavController, public app: App, private settings: SettingsProvider) {
    this.navCtrl.push(StudentHomePage, {
      param1: this.fontSize
    });
  }

  ionViewDidLoad() {
    console.log('ionViewDidLoad SettingsPage');
  }

  fontSize: number = 1.5; // default font size in `em`

  fontSizeChange($val: number){
    this.fontSize +=$val;
  }
}

StudentHome.html

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

<ion-content padding [ngStyle]="{'font-size': fontSize+'em' }" id="page">
  <h2>Welcome!</h2>
</ion-content>

StudentHome.ts

import { Component } from '@angular/core';
import { NavController } from 'ionic-angular';
import { NavParams } from "ionic-angular";

import { GamePage } from "../game/game";

@Component({
  selector: 'page-home',
  templateUrl: 'StudentHome.html'
})
export class StudentHomePage {
  private fontSize: any;

  constructor(public navCtrl: NavController, public navParams: NavParams) {
    this.fontSize = navParams.get('param1');
  }
}

Posts: 1

Participants: 1

Read full topic


Ionic build android --prod --release

$
0
0

@adelmis wrote:

WHEN RUN ionic build android --prod --release SHOW THIS ERROR :

Starting a Gradle Daemon, 2 busy and 1 incompatible Daemons could not be reused, use --status for details

The Task.leftShift(Closure) method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use Task.doLast(Action) instead.

    at build_9fgu75x5ivu3hc2sbdvsgjocx.run(C:\Users\Adel\Desktop\arayeshgah\platforms\android\build.gradle:140)

Observed package id ‘build-tools;23.0.0-rc2’ in inconsistent location ‘G:\Android.SDK.Tools.Bundle.v24.3.2\sdk\build-tools\23.0.0-preview’ (Expected ‘G:\Android.SDK.Tools.Bundle.v24.3.2\sdk\build-tools\23.0.0-rc2’)

Observed package id ‘build-tools;26.0.0-rc1’ in inconsistent location ‘G:\Android.SDK.Tools.Bundle.v24.3.2\sdk\build-tools\26.0.0-preview’ (Expected ‘G:\Android.SDK.Tools.Bundle.v24.3.2\sdk\build-tools\26.0.0-rc1’)

Observed package id ‘build-tools;23.0.0-rc2’ in inconsistent location ‘G:\Android.SDK.Tools.Bundle.v24.3.2\sdk\build-tools\23.0.0-preview’ (Expected ‘G:\Android.SDK.Tools.Bundle.v24.3.2\sdk\build-tools\23.0.0-rc2’)

Observed package id ‘build-tools;26.0.0-rc1’ in inconsistent location ‘G:\Android.SDK.Tools.Bundle.v24.3.2\sdk\build-tools\26.0.0-preview’ (Expected ‘G:\Android.SDK.Tools.Bundle.v24.3.2\sdk\build-tools\26.0.0-rc1’)

The JavaCompile.setDependencyCacheDir() method has been deprecated and is scheduled to be removed in Gradle 4.0.

Incremental java compilation is an incubating feature.

The TaskInputs.source(Object) method has been deprecated and is scheduled to be removed in Gradle 4.0. Please use TaskInputs.file(Object).skipWhenEmpty() instead.

Observed package id ‘build-tools;23.0.0-rc2’ in inconsistent location ‘G:\Android.SDK.Tools.Bundle.v24.3.2\sdk\build-tools\23.0.0-preview’ (Expected ‘G:\Android.SDK.Tools.Bundle.v24.3.2\sdk\build-tools\23.0.0-rc2’)

Observed package id ‘build-tools;26.0.0-rc1’ in inconsistent location ‘G:\Android.SDK.Tools.Bundle.v24.3.2\sdk\build-tools\26.0.0-preview’ (Expected ‘G:\Android.SDK.Tools.Bundle.v24.3.2\sdk\build-tools\26.0.0-rc1’)

Checking the license for package Google Repository in G:\Android.SDK.Tools.Bundle.v24.3.2\sdk\licenses

Warning: License for package Google Repository not accepted.

BUILD FAILED

FAILURE: Build failed with an exception.

  • What went wrong:
    A problem occurred configuring root project ‘android’.

You have not accepted the license agreements of the following SDK components:
[Google Repository].
Before building your project, you need to accept the license agreements and complete the installation of the missing components using the Android Studio SDK Manager.
Alternatively, to learn how to transfer the license agreements from one workstation to another, go to http://d.android.com/r/studio-ui/export-licenses.html

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

Total time: 4 mins 7.746 secs

(node:4200) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: cmd: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.

  • What went wrong:
    A problem occurred configuring root project ‘android’.

You have not accepted the license agreements of the following SDK components:
[Google Repository].
Before building your project, you need to accept the license agreements and complete the installation of the missing components using the Android Studio SDK Manager.
Alternatively, to learn how to transfer the license agreements from one workstation to another, go to http://d.android.com/r/studio-ui/export-licenses.html

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

(node:4200) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Posts: 2

Participants: 2

Read full topic

Easiest way to do 'dancing bars'?

Angular fire dependency problem

$
0
0

@pdj wrote:

this problem happen all of sudden…

I did
npm install firebase angularfire2 --save
to install.

and then, whatever I do like ionic Cordova run android --device. ionic cordova platform update android… etc…
I can’t even remove android platform for this error.

has this error.

cordova platform add android --save
Using cordova-fetch for cordova-android@~6.1.2

Error: Failed to fetch platform cordova-android@~6.1.2
Probably this is either a connection problem, or platform spec is incorrect.
Check your connection and platform name/version/URL.
Error: npm: Command failed with exit code 1 Error output:
npm WARN angularfire2@4.0.0-rc0 requires a peer of @angular/common@^4.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN angularfire2@4.0.0-rc0 requires a peer of @angular/compiler@^4.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN angularfire2@4.0.0-rc0 requires a peer of @angular/core@^4.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN angularfire2@4.0.0-rc0 requires a peer of @angular/platform-browser@^4.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN angularfire2@4.0.0-rc0 requires a peer of @angular/platform-browser-dynamic@^4.0.0 but none is installed. You must install peer dependencies yourself.

npm ERR! path /Users/jpd/Dropbox/pusher/node_modules/.bin/create
npm ERR! code EEXIST
npm ERR! Refusing to delete /Users/jpd/Dropbox/pusher/node_modules/.bin/create: is outside /Users/jpd/Dropbox/pusher/node_modules/cordova-android and not a link
npm ERR! File exists: /Users/jpd/Dropbox/pusher/node_modules/.bin/create
npm ERR! Move it away, and try again.

npm ERR! A complete log of this run can be found in:
npm ERR! /Users/jpd/.npm/_logs/2018-03-12T02_11_58_513Z-debug.log

then I install one of those dependency
typing npm i --save @angular/common@^4.0.0 on terminal .
but has more error saying

npm WARN @angular/common@4.4.6 requires a peer of @angular/core@4.4.6 but none is installed. You must install peer dependencies yourself.
npm WARN @angular/forms@5.0.3 requires a peer of @angular/common@5.0.3 but none is installed. You must install peer dependencies yourself.
npm WARN @angular/platform-browser@5.0.3 requires a peer of @angular/common@5.0.3 but none is installed. You must install peer dependencies yourself.
npm WARN @angular/platform-browser-dynamic@5.0.3 requires a peer of @angular/common@5.0.3 but none is installed. You must install peer dependencies yourself.
npm WARN angularfire2@4.0.0-rc0 requires a peer of @angular/compiler@^4.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN angularfire2@4.0.0-rc0 requires a peer of @angular/core@^4.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN angularfire2@4.0.0-rc0 requires a peer of @angular/platform-browser@^4.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN angularfire2@4.0.0-rc0 requires a peer of @angular/platform-browser-dynamic@^4.0.0 but none is installed. You must install peer dependencies yourself.

ionic info is as below.

cli packages: (/usr/local/lib/node_modules)

@ionic/cli-utils  : 1.19.1
ionic (Ionic CLI) : 3.19.1

global packages:

cordova (Cordova CLI) : 7.0.1

local packages:

@ionic/app-scripts : 3.1.8
Cordova Platforms  : none
Ionic Framework    : ionic-angular 3.9.2

System:

ios-deploy : 1.9.2
Node       : v8.4.0
npm        : 5.6.0
OS         : macOS High Sierra
Xcode      : Xcode 9.2 Build version 9C40b

Environment Variables:

ANDROID_HOME : not set

Misc:

backend : legacy

Posts: 1

Participants: 1

Read full topic

Build of Android APK failed with Push Notification and Badge in project

$
0
0

@lado wrote:

Hello,

I’ve added to ionic2 application project Push Notification:

$ ionic cordova plugin add phonegap-plugin-push
$ npm install --save @ionic-native/push

Which successfully builds android apk:

$ ionic cordova build

but if I add Badge:

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

and Camera plugin:

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

I got error with previous Push Notification installs in project, otherwise if I add it to separate project without Push Notification, it also successfully builds android apk, but with both in one project I got this:

Execution failed for task ‘:app:transformDexArchiveWithDexMergerForDebug’.

com.android.build.api.transform.TransformException: com.android.dex.DexException: Multiple dex files define Lme/leolin/shortcutbadger/impl/LGHomeBadger;

Not sure what can be cause, advice would be helpful:

Dex: Error converting bytecode to dex:
Cause: com.android.dex.DexException: Multiple dex files define Lme/leolin/shortcutbadger/impl/LGHomeBadger;
    UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dex.DexException: Multiple dex files define Lme/leolin/shortcutbadger/impl/LGHomeBadger;

com.android.dex.DexException: Multiple dex files define Lme/leolin/shortcutbadger/impl/LGHomeBadger;
 FAILED
        at com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:661)
        at com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:616)
        at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:598)
        at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:171)
        at com.android.dx.merge.DexMerger.merge(DexMerger.java:198)
        at com.android.builder.dexing.DexArchiveMergerCallable.call(DexArchiveMergerCallable.java:61)
        at com.android.builder.dexing.DexArchiveMergerCallable.call(DexArchiveMergerCallable.java:36)
        at java.util.concurrent.ForkJoinTask$AdaptedCallable.exec(ForkJoinTask.java:1424)
        at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
        at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
        at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
        at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:transformDexArchiveWithDexMergerForDebug'.
> com.android.build.api.transform.TransformException: com.android.dex.DexException: Multiple dex files define Lme/leolin/shortcutbadger/impl/LGHomeBadger;

* Try:
45 actionable tasks: 43 executed, 2 up-to-date

Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

* Get more help at https://help.gradle.org

BUILD FAILED in 34s
(node:8124) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: cmd: Command failed with exit code 1 Error output:
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: D:\IONIC\push_badge\platforms\android\app\src\main\java\com\adobe\phonegap\push\PushPlugin.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Dex: Error converting bytecode to dex:
Cause: com.android.dex.DexException: Multiple dex files define Lme/leolin/shortcutbadger/impl/LGHomeBadger;
    UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dex.DexException: Multiple dex files define Lme/leolin/shortcutbadger/impl/LGHomeBadger;

com.android.dex.DexException: Multiple dex files define Lme/leolin/shortcutbadger/impl/LGHomeBadger;
        at com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:661)
        at com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:616)
        at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:598)
        at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:171)
        at com.android.dx.merge.DexMerger.merge(DexMerger.java:198)
        at com.android.builder.dexing.DexArchiveMergerCallable.call(DexArchiveMergerCallable.java:61)
        at com.android.builder.dexing.DexArchiveMergerCallable.call(DexArchiveMergerCallable.java:36)
        at java.util.concurrent.ForkJoinTask$AdaptedCallable.exec(ForkJoinTask.java:1424)
        at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
        at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
        at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
        at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:transformDexArchiveWithDexMergerForDebug'.
> com.android.build.api.transform.TransformException: com.android.dex.DexException: Multiple dex files define Lme/leolin/shortcutbadger/impl/LGHomeBadger;

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

* Get more help at https://help.gradle.org

BUILD FAILED in 34s
(node:8124) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Posts: 1

Participants: 1

Read full topic

How to lazy loading with that get from Wordpress Content

$
0
0

@reanyouda wrote:

how can i implement lazy loading image with content that get from wordpress rest api ?

<content>
<p> title</p>
<img src=".."/>

Posts: 1

Participants: 1

Read full topic

Uncaught (in promise): Error: StaticInjectorError[HTTP] No provider for HTTP!

$
0
0

@ybh1231 wrote:

I’m new to Ionic but I’ve read some of the similar threads on this but still having trouble with it.

Basically what I have is a ionic super template, and I added the HttpModule import to it.

Here’s my app.module.ts,

import { HttpClient, HttpClientModule } from '@angular/common/http';
import { ErrorHandler, NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { Camera } from '@ionic-native/camera';
import { SplashScreen } from '@ionic-native/splash-screen';
import { StatusBar } from '@ionic-native/status-bar';
import { IonicStorageModule, Storage } from '@ionic/storage';
import { TranslateLoader, TranslateModule } from '@ngx-translate/core';
import { TranslateHttpLoader } from '@ngx-translate/http-loader';
import { IonicApp, IonicErrorHandler, IonicModule } from 'ionic-angular';
import { HttpModule } from '@angular/http';

import { Items } from '../mocks/providers/items';
import { Settings } from '../providers/providers';
import { User } from '../providers/providers';
import { Api } from '../providers/providers';
import { MyApp } from './app.component';

export function createTranslateLoader(http: HttpClient) {
  return new TranslateHttpLoader(http, './assets/i18n/', '.json');
}

export function provideSettings(storage: Storage) {
  return new Settings(storage, {
    option1: true,
    option2: 'Ionitron J. Framework',
    option3: '3',
    option4: 'Hello'
  });
}

@NgModule({
  declarations: [
    MyApp
  ],
  imports: [
    BrowserModule,
    HttpModule,
    HttpClientModule,
    TranslateModule.forRoot({
      loader: {
        provide: TranslateLoader,
        useFactory: (createTranslateLoader),
        deps: [HttpClient]
      }
    }),
    IonicModule.forRoot(MyApp),
    IonicStorageModule.forRoot()
  ],
  bootstrap: [IonicApp],
  entryComponents: [
    MyApp
  ],
  providers: [
    Api,
    Items,
    User,
    Camera,
    SplashScreen,
    StatusBar,
    { provide: Settings, useFactory: provideSettings, deps: [Storage] },
    { provide: ErrorHandler, useClass: IonicErrorHandler }
  ]
})
export class AppModule { }

And here’s the other ts file that uses HTTP

import { Component } from '@angular/core';
import { IonicPage, NavController, NavParams } from 'ionic-angular';
import { Storage } from '@ionic/storage';
import { HTTP } from '@ionic-native/http';

import { Item } from '../../models/item';
import { Items } from '../../providers/providers';

@IonicPage()
@Component({
  selector: 'page-search',
  templateUrl: 'search.html'
})
export class SearchPage {

  currentItems: any = [];

  constructor(public navCtrl: NavController, public navParams: NavParams, public items: Items, public storage: Storage, private http: HTTP) { }
}

In the module file I got the import at the top and in imports, no Http in providers. And code in the ts file is basically copy pasted from ionic doc. I don’t know what’s wrong with the code. Please help.

Posts: 1

Participants: 1

Read full topic

Creating thumbnails with Image Picker

$
0
0

@blue786 wrote:

Hello,

I have a requirement to fulfill where I have to be able to select multiple images from the photo library and create a thumbnail for each of them. I know that I can use the camera to select one image at a time and create a thumbnail, but I also want to be able to do so with multiple images. Is there a way to do so using the image picker plugin?

Posts: 1

Participants: 1

Read full topic


When the file is downloaded I want to show progress bar

$
0
0

@flycoders_sourav wrote:

When the file is downloaded I want to show progress bar. How can i do that

download(event,item){


  let targetPath = this.file.documentsDirectory;
  let getUrl = item._meta_gallery_images
  //
  let downloadFileName = getUrl.substr(getUrl.lastIndexOf('/') + 1); 
    this.file.createDir(targetPath,'video',true)
 .then((res) => console.log('createDir video res',res))
 .catch((err) => console.log('createDir video err',err));

const fileTransfer: FileTransferObject = this.transfer.create();
 const url =   getUrl;
var URL = encodeURI(url);
  fileTransfer.download(URL, this.file.externalDataDirectory +'video/'+ downloadFileName ,true).then((entry) => {
    console.log('download complete: ' + entry.toURL());
   
  }, (error) => {
    // handle error
    console.log('err',error);
  });
}

Posts: 1

Participants: 1

Read full topic

Http post request header issue

$
0
0

@roshanroshan wrote:

Can’t resolve all parameters for Headers: (?). i got this error message when i import headres from angular/http.

import { HttpModule, Headers, URLSearchParams} from ‘@angular/http’;

providers: [
StatusBar,
SplashScreen,
Geolocation,
Headers,
{provide: ErrorHandler, useClass: IonicErrorHandler}
]

if anyone have an idea about this please share,how to resolve this.

Posts: 3

Participants: 3

Read full topic

OneSignal Post Notification

$
0
0

@deybic wrote:

Is there a way to get the data received in a notification from OneSignal, when the application is closed ?

Posts: 1

Participants: 1

Read full topic

Button click not working in data-table bootstrap ionic 3

$
0
0

@sohambhatt wrote:

I have created in data-table using bootstrap. I have used data-table in ionic 3 website. But problem was I use edit button in data-table then first time it is working good . After searching record it can not working click and not call method. I’m get stuck please help me to solve this issue.

branch.html

<ion-content class="bgimg">


  <ion-grid style="color: aliceblue">
    <ion-row>
      <ion-col col-8></ion-col>
      <!--<ion-col col->-->
      <!--</ion-col>-->
      <ion-col col-2> <button float-end ion-button outline color="editcolor" style="color: white" (click)="addbranch()">Add</button></ion-col>
      <ion-col col-1></ion-col>

    </ion-row>
    <ion-row>
      <ion-col col-2></ion-col>
      <ion-col col-8>
        <div *ngIf="checkdatatable">
          <table id="example12">
            <thead>
            <tr>
              <th text-capitalize style="border: 1px solid rgba(255,255,255,1);" width="20%">Image</th>
              <th style="border: 1px solid rgba(255,255,255,1);">name</th>
              <th style="border: 1px solid rgba(255,255,255,1);">address</th>
              <th style="border: 1px solid rgba(255,255,255,1);" >phone</th>
              <th style="border: 1px solid rgba(255,255,255,1);" >pincode</th>
              <th  style="border: 1px solid rgba(255,255,255,1);" text-capitalize>Action</th>
            </tr>
            </thead>
            <tfoot>
            <tr >
              <th text-capitalize style="border: 1px solid rgba(255,255,255,1);">Image</th>
              <th style="border: 1px solid rgba(255,255,255,1);">name</th>
              <th style="border: 1px solid rgba(255,255,255,1);" width="15%">address</th>
              <th style="border: 1px solid rgba(255,255,255,1);" >phone</th>
              <th style="border: 1px solid rgba(255,255,255,1);" >pincode</th>
              <th  style="border: 1px solid rgba(255,255,255,1);" text-capitalize width="20%">Action</th>
            </tr>
            </tfoot>
            <tbody>
              <tr style=" background:rgba(0,0,0,0.0); color: white;font-size: 16px" *ngFor="let item of branchlist" >
              <td style="border: 1px solid rgba(255,255,255,0.5);">
                <img src="{{item.image}}" height="100px">
              </td>
              <td style="border: 1px solid rgba(255,255,255,0.5);">{{item.name}}</td>
              <td style="border: 1px solid rgba(255,255,255,0.5);">{{item.address}}</td>
              <td style="border: 1px solid rgba(255,255,255,0.5);">{{item.phone}}</td>
              <td style="border: 1px solid rgba(255,255,255,0.5);">{{item.pincode}}</td>

              <td style="border: 1px solid rgba(255,255,255,0.5);">
                <!--<input type="hidden" id="idmain" value="{{item._id}}">-->
                <button color="editcolor"  ion-button (click)="updatebranch(item._id)">Edit</button>
                <button color="deletecolor"  ion-button (click)="deletebranch(item._id)">Delete</button>
              </td>
            </tr>
            </tbody>
          </table>
        </div>
      </ion-col>
      <ion-col col-2></ion-col>

    </ion-row>
  </ion-grid>
</ion-content>

branch.ts

import { Component } from '@angular/core';
import {
  AlertController, IonicPage, LoadingController, NavController, NavParams, ToastController, ModalController,
  App
} from 'ionic-angular';
import {WebserviceallProvider} from "../../providers/webserviceall/webserviceall";
import { Storage } from '@ionic/storage';
import {LoginPage} from "../login/login";
/**
 * Generated class for the BranchesPage page.
 *
 * See https://ionicframework.com/docs/components/#navigation for more info on
 * Ionic pages and navigation.
 */

@IonicPage()
@Component({
  selector: 'page-branches',
  templateUrl: 'branches.html',
})
export class BranchesPage {

  resposnsdata:any;
  branchlist:any;
  checkdatatable:boolean=false;

  branchname = {name:''};
  branchupdatedata = {name:''};
  constructor(private storage: Storage,private app:App,public modalCtrl: ModalController,private alertCtrl: AlertController,private calldata:WebserviceallProvider,public navCtrl: NavController, public navParams: NavParams,public loadingCtrl: LoadingController,private toastCtrl: ToastController)
  {
    storage.get('token').then((val) => {
      console.log('Your Token is', val);
      if(val === null || val === "non")
      {
        this.app.getRootNav().setRoot(LoginPage);
      }
    });
      this.getshow();
  }

  ionViewEnter(){
    this.getshow();
  }

 myFunction(name) {
    document.getElementById("demo").innerHTML =
      "Welcome " + name;
  }

  getshow(){
    //this.presentLoading();
    this.calldata.branchlist().then((result) => {
      this.branchlist = [];
      this.resposnsdata = result;
      console.log(this.resposnsdata);
      this.branchlist = this.resposnsdata.data;
      $(document).ready(function () {
        // alert("call aklsdaklsd");
        $('#example12').DataTable();
       
      });

      this.checkdatatable=true;
      //check user name
      //console.log("print login Response >>"+this.resposnsdata);
      if (this.resposnsdata.status === 200) {

      }
      else
      {
        this.presentToast(this.resposnsdata.message);
      }
    }, (err) => {
      console.log("Error Block Call");
      this.presentToast("Server Problem");
    });
  }
  presentLoading() {
    let loader = this.loadingCtrl.create({
      content: "Please wait...",
      duration: 2000
    });
    loader.present();
  }
  presentToast(msg) {
    let toast = this.toastCtrl.create({
      message: msg,
      duration: 2000,
      position: 'bottom'
    });

    toast.onDidDismiss(() => {
      console.log('Dismissed toast');
    });

    toast.present();
  }
  ionViewDidLoad() {
    console.log('ionViewDidLoad BranchesPage');
  }
  deletebranch(bid){
    console.log(bid);
    //this.presentLoading();
    this.calldata.branchdelete(bid).then((result) => {

      this.resposnsdata = result;
      console.log(this.resposnsdata);
      this.getshow();
      //check user name
      //console.log("print login Response >>"+this.resposnsdata);
      if (this.resposnsdata.status === 200) {

      }
      else
      {
        this.presentToast(this.resposnsdata.message);
      }
    }, (err) => {
      console.log("Error Block Call");
      this.presentToast("Server Problem");
    });
  }
  addbranch() {
    var modalPage = this.modalCtrl.create('MAddbranchPage');
    modalPage.present();
    modalPage.onDidDismiss(data=>{
      this.getshow();
    });
  }

  updatebranch(id){
    console.log("edit call");
    var dataid = {
      bid:id
    };
    var modalPage = this.modalCtrl.create('MEditbranchPage',{data:dataid});
    modalPage.present();
    modalPage.onDidDismiss(data=>{
      this.getshow();
    });
  }
}

Posts: 1

Participants: 1

Read full topic

Asp.net web api + MS SQL SERVER Or Firebase

$
0
0

@mfouash wrote:

hi
i want to develop my new app
and i want to know what is the best solution for the back end asp.net web API+ MS SQL SERVER Or Firebase ?

thanks

Posts: 1

Participants: 1

Read full topic

Viewing all 48969 articles
Browse latest View live


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