Unsubscribe whenever you leave page 2, using ionViewWillLeave() or some other lifecycle event.
How to delete current page when pop()
Error in Upgrading to V3: Type 'IterableDiffer' is not generic
For one thing, get rid of the old "ionic-native" dependency. I would then recommend completely blowing away node_modules and whatever the npm5 lock file is called and reinstalling all node dependencies from scratch with npm i
.
Search only in component
Can you describe the larger picture of what you're trying to achieve? There has absolutely got to be a more idiomatic way of going about whatever it is.
Ion-segment issues
Segment content changes but segment button selection does not change
html snippet is as below
<ion-segment [(ngModel)]="segment" ion-text color="primary">
<ion-segment-button value="login">Log In</ion-segment-button>
<ion-segment-button value="signup" ion-text color="primary">Sign Up</ion-segment-button>
</ion-segment>
<div [ngSwitch]="segment">
<ion-list *ngSwitchCase="'login'">
<someTags>
</ion-list>
<ion-list *ngSwitchCase="'signup'">
<someTags>
</ion-list>
</div>
On successfully creating a user, I popup an alert and would like to switch the segment to the 'login'. I do the following:
this.signUp(this.registerForm.get('username').value, this.registerForm.get('password').value)
.then(result => {
if (result.signup) {
console.log('LoginPage :: onSignup : Switch to Login');
this.registerForm.reset();
this.segment = 'login';
this.cd.detectChanges();
} else {
console.log('LoginPage :: onSignup : Remain on SignUp');
this.segment = 'signup';
this.cd.detectChanges();
}
});
I find that the signup form gets cleared and the ion-list switches to that of the login...BUT the segment button selection remains on the signup...
Any ideas ?
Documentation ion-card
I don't intend this to sound harsh, but if that's really necessary then I think you need to reconsider the app design. Let Angular handle the DOM for you and you will be much happier in the long run.
Ionic2 with sqlite help
90% of apps don't really need to be interacting with SQLite directly at all, and if yours is one, you will have a much easier time just using ionic-storage, because it works both in browsers and on device.
Plugin error
I would suggest installing the plugin.
SQLCipher with Storage
Not really sure what threat model this makes much sense for, but if I were doing it I would put a layer above Storage
instead of below it, and use scrypt before Storage
sees anything.
I can not install local Notification and Cordova Toast plugin
Hi , I have 2 problems, I can not install local Notification and Cordovatoast plugin, I get the following error for both:
Running command - failed!
ERROR] Cordova encountered an error.You may get more insight by running the Cordova command above directly.
ERROR] An error occurred while running cordova plugin add https://github.com/EddyVerbruggen/Toast-PhoneGap-Plugin.git-... (exit code 1):
Error: Failed to fetch plugin https://github.com/EddyVerbruggen/Toast-PhoneGap-Plugin.git via registry.
Probably this is either a connection problem, or plugin spec is incorrect.
Check your connection and plugin name/version/URL.
Error: cmd: Command failed with exit code 1 Error output:
npm ERR! exited with error code: 128
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Aurora\AppData\Roaming\npm-cache_logs\2017-07-06T08_22_04_912Z-debug.log
As for the local notification plugin give the error described above, but I do not understand why in the plugin folder there is, and I also find it in the dependencies of the package.json file, but not in the plugin object.
Toast plugins give only the error.
I also noticed that after these failed setup attempts, my app can only be seen with the emulator, on my device I get the same error when I install the Local Notification and Toast plugins.
Today is the 3rd day I'm stuck, how can we fix it?
Save Canvas image to the device/gallery on android
So i am trying for a few days now to take an image from the Canvas of my application and save that to the device... i've tried some (with no result) plugins like: Save2Canvas, Base64 To Gallery, Canvas2ImagePlugin and Cordova base64ToGallery Plugin...
I am using:
Cordova 7.0.1
Ionic 1.x
Right now the part of my Js. function to save is like this
var image = canvas
.toDataURL("image/png");
window.location.href=image;
Wich works on ionic 1.x via browser but not on the device...
Image not displaying while displaying contacts
I find this entire code structure baffling. We are looping across contacts
and it looks to me like we pushing new items onto it representing a contact that is already in the list. I can't see how that makes any sense.
Form Validation - FormControl touched being set immediately on focus
I am using reactive forms and the FormControl property touched/untouched is supposed to represent if a user has entered a control AND triggered the blur event. But for some reason, the controls are being set to having been touched immediately when they are focused. Is this an angular bug, or an Ionic bug? Is there a way to fix this with configuration?
NavController cache problem
I suspect you have only one view in the root nav stack, which is what you're interacting with. Why not just let the navigation system do its job instead of trying to micromanage it?
Ionic - Dynamic forms. Formbuilder triggers after some delay and generates error
IMHO, there is too much going on in the dropdown. If you want an (ngModelChange)
handler, you should lose the output binding on [ngModel]
, and it also seems very strange to me to have both ngModel
binding and formControlName
, so I would choose one or the other.
Furthermore, I would move the dropdown that controls which form is being displayed out of the form completely, so I guess that goes to getting rid of formControlName="type"
.
I don't know if this makes sense for your app or not, but another option that may perform better is to have all of the forms in the template, and use an accordion-like construct to control their visibility.
Reusing components?
There are two things in the OP that I would suggest not emulating:
- injecting
App
in service providers - passing properties to
sendHTTPRequest()
Help needed: A "solved" problem with end tags
Getting ID of detail-page instance that is currently open
Page1
knows what item it is showing, so why not delegate the question of how to handle the notification to the page instead of having a global monolithic dispatch function?
Search only in component
Hello,
I am probably wrong. I want something similar to a usercontrol. In vb.net, c# I create the control for all my needs and reference one or many of them and have full control over each control and that content.
So if I get for example an @Input or anyway else an value, I want manipulate content of this specific instance of my component: That can be a simple text or a bunch of manipulation on a svg or what ever,.
So for example svg of all my used components will become part of the dom, but I want not search the dom, I want reference a instance of my component and then make my doings without influence the other instance of my component..
This is related to my question get content of ion-card.
Clearly this is not c# or vb.net and I am completly new to this web stuff and maybe I see not the right implementation pattern.
Best regards, anna
Add platform ios failed for cordova-ios@3.9.2
C:\Users\Muhammet Tayyip\Desktop\denemeProje>rm -rf ~/.cordova
'rm' is not recognized as an internal or external command,
operable program or batch file.
Ionic2 ion-select with search bar
Hi, were yo able to implement it? I'm having the same problem. Thank you.