Quantcast
Channel: Ionic Forum - Latest posts
Viewing all 228535 articles
Browse latest View live

Ionic editable list in ionic1

$
0
0

Hi @thaker,
Thank you for your reply, my problem is not really the design, but the functionnality. How to achieve the update of article's number simply by clicking one of the buttons.... For the design i can use the card system.


ngFor from object?

$
0
0

Maybe try using ngFor with ngIf?

    <ion-item *ngFor="let p of cart">
        <ng-container *ngIf="something">
        </ng-container>
    </ion-item>

ngFor from object?

$
0
0

Hi,
you should transform your object to an array.

For example with a function like this:

var objectToArray = function(obj) {
  var arr =[];
  for(let o in obj) {
    if (obj.hasOwnProperty(o)) {
      arr.push(obj[o]);
    }
  }
  return arr;
};

Then you use this for the ngFor loop, if the array is empty nothing will show up as expected.

Hope this helps.

How to add Back button to Home

$
0
0

Ionic has a different navigation when press a function from side menu. When you press a back button from handset, it will straight away exit.

I refer to this tutorial and make the changes to my app.js but it unable to back to home page but exit the app.

The code suppose to (which is what I needed):

1.if not at home page, it will back to previous page if press hardware back button
2.if it is at home page, press hardware back button will show pop up to confirm if user really want to exit.

app.js

angular.module('myapp', ['ionic', 'myapp.controllers', 'myapp.factories'])
.run(function($ionicPlatform,$state,$ionicHistory,$ionicPopup) {
  $ionicPlatform.ready(function() {
if (window.cordova && window.cordova.plugins.Keyboard) {
      cordova.plugins.Keyboard.hideKeyboardAccessoryBar(true);
      cordova.plugins.Keyboard.disableScroll(true);
    }
      if (window.StatusBar) {
        // org.apache.cordova.statusbar required
        StatusBar.styleDefault();
      }

    $ionicPlatform.registerBackButtonAction(function (event) {
    event.preventDefault();
    if ($state.current.name == "app.home") {
      var confirmPopup = $ionicPopup.confirm({
        title: 'Exit',
        template: 'Confirm Exit'
      });

      confirmPopup.then(function (res) {
        if (res) {
          navigator.app.exitApp();
        }

      });
    } else {
      $ionicHistory.nextViewOptions({ disableBack: true });
      $state.go('app.home');
    }
  }, 100);//registerBackButton

});
})

  $stateProvider
      .state('app', {
        url: '/app',
        abstract: true,
        templateUrl: 'templates/menu.html',
        controller: 'menuCtrl'
      })
      .state('app.home', {
        url: '/home',
        views: {
          'menuContent': {
            templateUrl: 'templates/home.html',
            controller: 'homeCtrl'
          }
        }
      })
      .state('app.personalitem', {
        url: '/personalitem',
        views: {
          'menuContent': {
            templateUrl: 'templates/personalitem.html',
            controller: 'personalitemCtrl'
          }
        }
      })
      .state('app.pStock', {
        url: '/pStock',
        views: {
          'menuContent': {
            templateUrl: 'templates/pStock.html',
            controller: 'pStockCtrl'
          }
        }
    });
angular.module('myapp.factories', []);
angular.module('myapp.controllers', []);

How to set Popover full screen

$
0
0

You're totally right !, Thank you.
one last thing how i can pass selected value to main page that opened the modal

Ionic Native Gelocation not working

$
0
0

After a long trial and error. I removed the platorm and the plugin and re added it. It worked, don't know what exactly happened

Ionic android gradle build takes long time!

$
0
0

Ya I had updated cordova to v7.0.1

Ionic Battery Status on iOS

$
0
0

Sujan,

why battery status update after plugging the mains charger in/out takes place on the Android after tapping the touch screen?
I am running my test app on Android GalaxyTab (ionic run android). You see my code at the top of this thread. How do I get debug information on the screen like console.log()...... after invoking "ionic run android"


Pass data on modal close?

$
0
0

Is there any way to pass some data to parent page from modal on close?

Pass data on modal close?

$
0
0

Yes you can receive the data inside the onDidDismiss like this:

let myModal = this.modalCtrl.create('MyModalPage');
myModal.onDidDismiss(data => {
  // Data is your data from the modal
});
myModal.present();

Inside your Modal page you then have to pass the object inside the dismiss function like this:

this.viewCtrl.dismiss({specialData: 'whatever'});

That's it!

Ionic Native Barcode Scanner "Property 'scan' does not exist on type 'BarcodeScanner'

$
0
0

Inside your list page you need to make sure that you import the barcode scanner and make it available through the constructor like:

import { BarcodeScanne r} from '@ionic-native/barcode-scanner';

constructor(barcodeScanner: BarcodeScanner)

Also your code looks like your are using the old full Ionic Native package, right?

The new approach has all of the plugins in single packages, so perhaps that is also a problem!

Check out the documentation for a full guide how to add the barcode scanner.

Making a Website Using Ionic & Firebase Hosting

$
0
0

Looks awesome! That's the power of Ionic :slight_smile:

One question, how did you code the special footer area with all the links? Is it inside an ion-footer or some special component you created? Thanks!

ngFor from object?

$
0
0

Oh, thanks a lot! It worked! Just one more thing - how do I echo <p>Your cart is empty</p> if the array is empty?

Making a Website Using Ionic & Firebase Hosting

$
0
0

@saimon Looks like a custom component, called global-footer. It's inside ion-content with the rest of the stuff.

Getting ID of detail-page instance that is currently open

$
0
0

To handle how PushNotifications are shown to my users while the app is open, I need to identify, which page the user is currently on. I can do that by:

if ( (this.navCtrl.getActive().component === Page1) ){
    // user is currently on Page1
    // handle push notification
}

Unfortunately, this is not enough. Page 1 is a detail page, which shows details of an item. Let's say there are 3 items: Banana (id: 1), Apple (id: 2) and Orange (id: 3).

I know need to know, whether the user is currently looking at Page1 for item1, item2 or item3. I want to do something like this:

if ( (this.navCtrl.getActive().component === Page1 && data.itemID === "page1-itemId") ){
    // data.itemID is the ID i get from the push notification
    // "page1-itemId" is what I desire to get somehow
}

How could I find out about page1-itemId?


Audio-Video calling with WebRTC

$
0
0

Ionic Community,

Are you planing Audio-Video calling plugin with WebRTC or some other technique ? Or is there existing plugins with Ionic 3 ?

Stripe native plugin

FCM Push notification handler

$
0
0

@Sujan12,
After disabling notification for the device,can I be able to enable notification for the same device later on.
New to Ionic,still learning....

Thanks.

Import Google Material Icon in Ionic Apps

$
0
0

Hello philipgriffin,

I have added my code into src/theme/variables.scss and i get the same error. In my browser i can see icon, when i export to android platform i see a icon name not a svg image.

Regards,

Best practice: Sharing user credentials across all pages in app

Viewing all 228535 articles
Browse latest View live


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