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.
Ionic editable list in ionic1
ngFor from object?
Maybe try using ngFor with ngIf?
<ion-item *ngFor="let p of cart">
<ng-container *ngIf="something">
</ng-container>
</ion-item>
ngFor from object?
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
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
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
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!
Ya I had updated cordova to v7.0.1
Ionic Battery Status on iOS
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?
Is there any way to pass some data to parent page from modal on close?
Pass data on modal close?
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'
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
Looks awesome! That's the power of Ionic
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?
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
@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
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
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
Very clear!
Thank you so much!
FCM Push notification handler
@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
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
Check this documentation. This will help you.