Quantcast
Channel: Ionic Forum - Latest topics
Viewing all 70844 articles
Browse latest View live

Problem adding tabs in template

$
0
0

@Iza wrote:

Hello,

I'm running the side menu starter project on latest ionic v2 beta and I get a maximum call stack size exceeded error.

The page template looks like this:

<ion-header>
  <ion-navbar>
    <button menuToggle>
      <ion-icon name="menu"></ion-icon>
    </button>
    <ion-title>Page 2</ion-title>
  </ion-navbar>
</ion-header>

<ion-content>
  <ion-tabs>
      <ion-tab tabIcon="heart" ></ion-tab>
      <ion-tab tabIcon="star" ></ion-tab>
    </ion-tabs>
</ion-content>

Any idea why I'm getting this?
Thank you.

Posts: 1

Participants: 1

Read full topic


Ion-nav-button with custom image

$
0
0

@fitfuse wrote:

Does anyone know how to use a custom image (png or jpg) as the image for an ion-nav-button in the top nav-bar? It's simple enough to do it for menu items in a side menu and for navigation tabs at the bottom, but I have found no way to use a custom image for an ion-nav-button in the top nav-bar. Any help would be greatly appreciated.

Posts: 1

Participants: 1

Read full topic

Hard to swipe on android

$
0
0

@jf1 wrote:

hello,
i would like to swipe on android.
where do i set on-swipe-left / on-swipe-right ?
try ion-view and on ion-content nodes but very very hard to swipe.

Posts: 1

Participants: 1

Read full topic

DI keeps injecting empty object?

$
0
0

@rastographics wrote:

I have a service:

import {Injectable} from '@angular/core';
import {Subject} from "rxjs";

@Injectable()
export class AuthTracker {
  public loginNotifier: Subject<boolean>;
}

When I import into my component, the authTracker param is just an empty object (no "loginNotifier" property):

import {NavController} from "ionic-angular";
import {AuthTracker} from '../../providers/authentication/auth-tracker';
import {Injectable, Component} from "@angular/core";
import {LoginPage} from "./login";
import {HelloIonicPage} from "../../pages/hello-ionic/hello-ionic";

@Component({
  template: ''
})
export class DispatchPage {
  constructor(nav: NavController, authTracker: AuthTracker) {
    let logsub = (loggedin) => {
      if (loggedin) {
        nav.setRoot(HelloIonicPage);
      } else {
        nav.setRoot(LoginPage);
      }
    };
    authTracker.loginNotifier.subscribe(logsub);
  }
}

I have the AuthTracker token provided in bootstrap:

ionicBootstrap(MyApp,[AuthTracker]);

No errors coming up. Please, what am I missing?

Posts: 2

Participants: 1

Read full topic

Slider - Preview previous and next slides

Ionic 2 app scroll lag in Samsung Galaxy?

$
0
0

@menshinobi wrote:

My app runs fine in Nexus 6 and LG G2 phone but when I opened the app in Samsung Galaxy S6, S7 and S7 Edge, the scroll suddenly lags a lot. Does any one have the same trouble?

Posts: 1

Participants: 1

Read full topic

Android Version Recommendations

$
0
0

@sukhsingh wrote:

Are there any recommendations on what version of Android to test.

I see Nexus with 6.0
Most of the Samsung with 5.1
And others with KitKat

We are a startup, so the budget is limited :slight_smile:

Posts: 1

Participants: 1

Read full topic

How to include a plain js library in Ionic 2 typescript project

$
0
0

@peterjc wrote:

Hi, I think I still sadly still don't understand how typescript/browserfy work together to include the actual js files into app.bundle.js in the Ionic 2 build.

This time I want to use a library that has no type definition file (mqtt.js). I have installed the js library and see it in the node_modules.

Within the node_modules/mqtt/lib.client.js file, there is an export at the end...

module.exports = MqttClient;

So I want to use this MqttClient in one of my pages.

After Building the app, when I look into app.bundle.js I do not see MqttClient anywhere.

In tsconfig.json I have attempted to include the above file..

 "filesGlob": [
  "**/*.ts",
  "!node_modules/**/*",
  "node_modules/mqtt/lib/client.js"   <- added this
  ],

but I still don't get it.

I thought that browserfy would scan the node_modules and read each package,json file, but now not so sure.

Can anyone shine some light on how I can include just the pure js libraries, and then how to import and use them in my typescript files. I have searched for hours looking for this but to no avail.
Thanks in advance for any help!

[UPDATE]
I added 'node_modules/mqtt/mqtt.js'into ionic-gulp-browserify-typescript folder index.js as below

var defaultOptions = {
   watch: false,
   src: ['./app/app.ts', './typings/index.d.ts', 'node_modules/mqtt/mqtt.js'],
   outputPath: 'www/build/js/',
  ....

At the bottom if the library file, mqtt.sj, we have the following

       // Expose MqttClient
       module.exports.MqttClient = MqttClient;
       module.exports.Client = MqttClient;
       module.exports.Store = Store;

       // Expose servers
       module.exports.Server = MqttServer;
       module.exports.MqttServer = MqttServer;
       module.exports.SecureServer = MqttSecureServer;
       module.exports.MqttSecureServer = MqttSecureServer;

Now when I look into app.bundle.js I do see module.exports.MqttClient = MqttClient; I do not see MqttServer

I still don't seem to be able to import this into my .ts page file though, so still not sure what to do here.

I can add ///<reference path="../../../node_modules/mqtt/mqtt.js" /> and this seems to resolve ok, but I cannot find how to import,,

e.g. import * as mqtt from 'mqtt/mqtt'; typescript reports "'cannot find module mqtt/mqtt".

If I try something like let client = new MqttClient(); MqttClient is always undefined.

Also, is the above the correct place to add js files?

Posts: 1

Participants: 1

Read full topic


Blue screen error

Wiered problem with ionic2 Navigation

$
0
0

@Trivedi wrote:

Hi Guys,

I am facing a very weird problem with navigation within the one place of my application and not able to figure out where the problem is. To simplify I have recorded a video here.

Also Supported code here:

https://github.com/tejit2004/app

Problem : When i navigate through pages so views are stacked through push but by going back it seems at one place nav.pop performs twise and 2 times views are calling.

If you want to see the code for specific pages, I have attached all supported Files. Please go through it and help me to solve as I am about to publish the app but because o this bug not able to.

As trying to solve this from last few days, your help would be appreciated.

Posts: 1

Participants: 1

Read full topic

Ionic 2 Publishing

$
0
0

@keithmichelson wrote:

Did I miss something in the docs about publishing or are there not directions yet because it's still in beta?

Thanks.

Keith

Posts: 3

Participants: 2

Read full topic

Closing ionic app code

MediaPlugin and native controller integration in Ionic 2

Bit6 integration with ionic

$
0
0

@amit025 wrote:

has anyone integrated bit 6 with ionic ? i am trying to integrate the bit6 plugin, video and audio works fine but unable to integrate the chat feature facing problem unable to specify the sender and receiver .please help

Posts: 1

Participants: 1

Read full topic

Ionic-plugin-deeplinks on PGB

$
0
0

@kim_ras wrote:

Hi
I am trying to get my project build on Phonegap Build using ionic-plugin-deeplinks.. it Builds fine and I can see the object in my code. But for some reason it does not work.It just opens the iTune store to install the app (Which should be proof that my server settings works)

So it is an issue ion the app, and i narrowed it down to properly being the xxxxxxx.entitlement missing.

Does anyone have this working ?

Thanks in advance
Kim

Posts: 1

Participants: 1

Read full topic


If i turn on the location using diagnostic and cannot get geo location instantly

$
0
0

@compfrkz wrote:

Hi i am trying trying to turn on the location using diagnostic and when i try to get geo coordinates instantly its not working its taking around 10 sec if i start the gps and for subsequent calls geo location is got instantly any way to reduce the time for first call?

my code snippet

     if (window.cordova) {
        cordova.plugins.diagnostic.isLocationEnabled(function(enabled) {
           // alert("Location is " + (enabled ? "enabled" : "disabled"));
    		if(!enabled){

    			cordova.plugins.locationAccuracy.request(function (success){
        console.log("Successfully requested accuracy: "+success.message);
     $cordovaGeolocation
   .getCurrentPosition(posOptions)

   .then(function (position) {
      $scope.lat  = position.coords.latitude;
     $scope.lng = position.coords.longitude;
    	});
    }, function (error){
       console.error("Accuracy request failed: error code="+error.code+"; error message="+error.message);
       if(error.code !== cordova.plugins.locationAccuracy.ERROR_USER_DISAGREED){
           if(window.confirm("Failed to automatically set Location Mode to 'High Accuracy'. Would you like to switch to the Location Settings page and do this manually?")){
               cordova.plugins.diagnostic.switchToLocationSettings();
           }
       }
    }, cordova.plugins.locationAccuracy.REQUEST_PRIORITY_HIGH_ACCURACY);
    		}
        }, function(error) {
            alert("The following error occurred: " + error);
        });
    }

it takes around 10 sec when the location is turned on for first time any idea to reduce time on first call?

Posts: 1

Participants: 1

Read full topic

Sending two parameters to a tab

$
0
0

@riteshbhat17 wrote:

i know how to send a single parameter but can anyone please tell how to send two params(parameter) to a tab?

for single param we use [rootParams]="chatParams"
and in .ts we use this.chatParams = params.data

Posts: 1

Participants: 1

Read full topic

Why is Ionic2 still using webview?

Ionic 2 SqlStorage iOS SELECT doesn't return data

$
0
0

@stefanleever wrote:

I've recently started developing an app using Ionic 2 because of it's out-of-the-box support of SqlStorage.

The SqlStorage implementation works great for Ionic Serve and the Android Emulator but not on iOS.

The SqlStorage implementation on iOS works to the point where you can create the tables and insert some data but I can't seem to retrieve any data with a simple SELECT statement such as:

storage.query('SELECT * FROM box WHERE boxHidden = ?', [0]).then((resp) => {
   console.log(JSON.stringify(resp));
});

From this query I am only getting back the following resultset:

{
"tx": {
	"db": {
		"openargs": {
			"name":"__ionicstorage",
			"location":2,
			"createFromLocation":0,
			"backupFlag":2,
			"existingDatabase":false,
			"dblocation":"nosync"
		},
	"dbname":"__ionicstorage"
	},
	"txlock":true,
	"readOnly":false,
	"executes":[],
	"finalized":true
},
"res": {
	"rows": {
		"length":3
	},
	"rowsAffected":0
}
}

As opposed to Android where I am getting a resultset with an arraly of data with 3 objects and the length element.

Has anybody got a similar experience and knows how to approach/solve this?

Thank you very much in advance.

Best regards,

Posts: 1

Participants: 1

Read full topic

Making cordova-plugin-contacts work in Ionic2

$
0
0

@longliveajay wrote:

For some reason my application fails to read contacts from user's phone:

get(){
Contacts.find(['*']).then((lists) => {
this.contacts = lists;

    let contentHeader: Headers = new Headers({"Content-Type": "application/json"});
    let url = `http://localhost:8080/api/contacts`;
    return this._http.post(url, lists, {'headers': contentHeader});
});

}

The template

<button type="button" (click)="get()">Contacts</button>
<ion-list>
    <ion-item *ngFor="let contact of contacts">{{contact.displayName}}</ion-item>
</ion-list>

I can't understand why it fails to read contacts. Any help ?

Posts: 1

Participants: 1

Read full topic

Viewing all 70844 articles
Browse latest View live


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