While you wait for better answers, it might be worth investigating to see if the problem persists when using Angular’s HttpClient
instead of the plugin one.
HTTPS API calls fail using iOS 13 SDK (HTTP load failed)
CSS keyframe animation on ion-item is not transitioning smoothly
I think you’ve hit the nail on the head here. It’s pretty obvious that the issue lies with Ionic’s Web Components and that is why you’re experiencing a difference in animation VS plain HTML.
So just use plain HTML and CSS where you need to and avoid Web Components.
This scope inside a callback
WOW, this is a dense answer!!! I’m not familiar with Factory but I looked it up and it seemed just like a class implementing an interface, so I implemented it and now the only dependency of the Home component is the NetworkProvider, which is nice. So far I have the following
network-provider.ts
export interface Host {
addr: string;
start(): void ;
send(dest:string, msg:string): void;
receive: Function;
getActivities():Observable<string>;
}
...
class HostFactory implements Host {
public addr:string;
public receive: Function = null;
public net: NetworkProvider; //network that created the host
constructor(addr:string) { this.addr=addr; }
start(){
this.net.join(this.addr).subscribe((p:Packet) => {
if (p) {
this._activitie$.next("R-"+p.sa+":"+p.da+":"+p.payload); //log activities for curious folks
if (this.receive) {
this.receive(p); //call host receive handler
}
}
});
...
@Injectable()
export class NetworkProvider {
public createHost(addr:string): Host {
let h = new HostFactory(addr);
h.net = this;
return h;
}
home.ts
import { NetworkProvider, BroadcastAddress, Host, Packet } from '../../providers/network-provider';
@Component({...})
export class HomePage {
clientA:Host;
server:Host;
constructor(public net:NetworkProvider...) {
this.clientA = net.createHost('AA');
this.clientA.receive = (p:Packet) => { this.clientReceiveMachine(this.clientA, p); }
this.server = net.createHost('55');
this.server.receive = (p:Packet) => { this.serverReceiveMachine(this.server, p); }
}
clientReceiveMachine(h:Host, p:Packet) {
console.log('Rcvd.hAddr:'+h.addr+' sa:'+p.sa+' da:'+p.da+' p:'+p.payload);
}
serverReceiveMachine(h:Host, p:Packet) {
console.log('Rcvd.hAddr:'+h.addr+' sa:'+p.sa+' da:'+p.da+' p:'+p.payload);
if (p.payload==='Hello') {
h.send(p.sa, "HelloBack");
}
}
Even though it works fine, there’s a few things leaving me uncomfortable:
- in order for the host to send and receive packets, it needs a reference to the network, so I set it with this in
createHost
--> doesn’t feel right - clients and servers need a different logic when receiving packets so I use a receive:Function property on the interface --> can be seen as a handler but too similar to callbacks to feel comfortable
So once again, I’m sure there is a better way.
Complete code can be found at https://stackblitz.com/edit/i3-xs-net
Why npm install doesnt install angular/dev-kit
hi while i am using npm to install dependencies at the end i got this error:
and also i can not serve ionic because of a despondency [![enter image description here]
here is the part of log
17252 verbose optional SKIPPING OPTIONAL DEPENDENCY:
17252 verbose optional The operation was rejected by your operating system.
17252 verbose optional SKIPPING OPTIONAL DEPENDENCY: It's possible that the file was already in use (by a text editor or antivirus),
17252 verbose optional SKIPPING OPTIONAL DEPENDENCY: or that you lack permissions to access it.
17252 verbose optional SKIPPING OPTIONAL DEPENDENCY:
17252 verbose optional SKIPPING OPTIONAL DEPENDENCY: If you believe this might be a permissions issue, please double-check the
17252 verbose optional SKIPPING OPTIONAL DEPENDENCY: permissions of the file and its containing directories, or try running
17252 verbose optional SKIPPING OPTIONAL DEPENDENCY: the command again as root/Administrator.
17253 verbose stack Error: ENOENT: no such file or directory, rename 'F:\ionic\itosoft\amnasnad-lts\node_modules\@angular-devkit\build-angular\node_modules\parse5' -> 'F:\ionic\itosoft\amnasnad-lts\node_modules\@angular-devkit\build-angular\node_modules\.parse5.DELETE'
17254 verbose cwd F:\ionic\itosoft\amnasnad-lts
17255 verbose Windows_NT 10.0.18362
17256 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install"
17257 verbose node v12.16.1
17258 verbose npm v6.13.4
17259 error code ENOENT
17260 error syscall rename
17261 error path F:\ionic\itosoft\amnasnad-lts\node_modules\@angular-devkit\build-angular\node_modules\parse5
17262 error dest F:\ionic\itosoft\amnasnad-lts\node_modules\@angular-devkit\build-angular\node_modules\.parse5.DELETE
17263 error errno -4058
17264 error enoent ENOENT: no such file or directory, rename 'F:\ionic\itosoft\amnasnad-lts\node_modules\@angular-devkit\build-angular\node_modules\parse5' -> 'F:\ionic\itosoft\amnasnad-lts\node_modules\@angular-devkit\build-angular\node_modules\.parse5.DELETE'
17265 error enoent This is related to npm not being able to find a file.
17266 verbose exit [ -4058, true ]
full log at https://gofile.io/?c=dKTtf3
This scope inside a callback
No, it’s a singleton that spawns things.
I’m assuming for now that there is only a single Network
. To deal with multihomed Host
s, you would have to convert addr
into a list of addr
/network pairs.
// this does not deal with multihomed hosts atm
export interface Host {
addr: string;
packets$: Observable<Packet>;
activities$: Observable<string>;
}
@Injectable()
class HostFactory {
constructor(private net: NetworkProvider) {}
createHost(addr: string): Host {
let rv = {addr} as Host;
rv.packets$ = this.net.join(addr);
rv.activities$ = rv.packets$.pipe(
map(pkt => `R-${p.sa}:${p.da}:${p.payload}`));
return rv;
}
// if needed, but i would try to make it not needed
disposeHost(host: Host): void {
this.net.unjoin(addr);
}
}
@UntilDestroy()
class HomePage {
clientA: Host;
server: Host;
constructor(private hoster: HostProvider, private net: NetworkProvider) {
this.clientA = hoster.createHost("AA");
this.clientA.packets$.pipe(untilDestroyed(this))
.subscribe(pkt => this.clientReceiveMachine(this.clientA, pkt));
this.server = hoster.createHost("55");
this.server.packets$.pipe(untilDestroyed(this))
.subscribe(pkt => this.serverReceiveMachine(this.server, pkt));
}
serverReceiveMachine(h: Host, p: Packet) {
console.log('Rcvd.hAddr:'+h.addr+' sa:'+p.sa+' da:'+p.da+' p:'+p.payload);
if (p.payload==='Hello') {
this.net.send({sa: h.addr, da: p.sa, payload: "HelloBack"});
}
}
}
Solved by not having hosts send and receive packets. The network does that.
Not something Host
should concern itself with. Done as shown above by changing what you do when you subscribe
to the packet stream coming into that Host
(or derivative thereof such as activities$
). All Host
s do is effectively filter all the packets on the network down to the ones where da
matches that Host
's addr
.
Why npm install doesnt install angular/dev-kit
Anything unusual we should know about the filesystem on that F:
drive?
How to set value dynamically default value in ion-select-option
I’m using Ionic 4.
I want to show a default value in ion-select-option.
Option’s values come from the server.
API works all values show but on click of ion-select.
But I want to show the default value.
Response
{"success":1,"service_details":[{"id":"1","name":"Job\/Service","status":"1"},{"id":"2","name":"Student","status":"1"},{"id":"3","name":"House Wife","status":"1"},{"id":"4","name":"Business","status":"1"}]}
register.ts
userData = { "fname": "", "lname": "", "contact_no": "", "email_id": "", "password": "",
"business_type": "", "organization_name": "", "designation": "", };
constructor () {
this.userData.business_type = "1";
}
getAllService(){
let loading = this.loadingCtrl.create({
spinner: 'circles',
message: 'Please wait...'
}).then(loading => loading.present());
this.authService.getData("get_all_service_type.php").then((result) => {
this.items = result;
this.success = this.items.success;
console.log(this.success);
if (this.success == 1) {
this.loadingCtrl.dismiss();
this.serviceData = this.items.service_details;
console.log(this.serviceData);
} else {
this.message = this.items.message;
this.loadingCtrl.dismiss();
}
}, (err) => {
this.loadingCtrl.dismiss();
console.log("Error", err);
});
}
register.html
<ion-item>
<ion-label>Occupation </ion-label>
<ion-select value="Job/Service" (ionChange)="optionsFn()" name="business_type" [(ngModel)]="userData.business_type">
<div *ngFor="let item of serviceData">
<ion-select-option value="{{item.id}}">{{item.name}}
</ion-select-option>
</div>
</ion-select>
</ion-item>
OR
<ion-select (ionChange)="optionsFn()" name="business_type" [(ngModel)]="userData.business_type">
<ion-select-option *ngFor="let item of serviceData" value="{{item.id}}" [selected]="userData.business_type == item.name">{{item.name}}</ion-select-option>
</ion-select>
Automatic call recorder using ionic 3
Hi, do u get any idea to record call in ionic? please help me .I need it its urgent.
Ionic 4 app run after swipe out/killed
I need to call a method in every second (my app include a count down) and it’s working when the app in the thread but once I swipe out the app the countdown stops. How can I manage to do this?
Ionic get array from json - web service
What is the Result when you just log the error
?
Ionic v5: iFrame does not load on iOS
Die gute alte Deutsche Bahn
- Does it work on Android?
Calendar on page
below i am mention ts and html code for ionic 4 this will solve your problem
ts file
import { CalendarComponentOptions, DayConfig , CalendarModal, CalendarModalOptions} from 'ion2-calendar';
export class CalenderPage implements OnInit {
test: DayConfig[]=[];
public optionsRange: CalendarComponentOptions = {
//from: new Date(2019, 0, 1),
from: new Date(2019, 11, 1),
to: new Date(2020, 2, 15),
pickMode: 'range',
daysConfig: this.test
};
constructor(
public datepipe: DatePipe,
) {
//disable next date from today and previous date from one month after
var now = new Date();
this.optionsRange.from = new Date(now.getFullYear(), now.getMonth(), now.getDate()-30);
this.optionsRange.to = new Date(now.getFullYear(), now.getMonth(), now.getDate());
}
}
in html
<ion-calendar [(ngModel)]="dateRange" [readonly]="false" [options]="optionsRange" (change)="onChange($event, 2)" [type]="type" [format]="'YYYY-MM-DD'" >
</ion-calendar>
Why npm install doesnt install angular/dev-kit
nothing
i checked drive c (os drive) same error
Ionic - Global navigation change event
Hello All
how to use this for ionic 4 ?
Stencil compiler programmatically
Hello,
does anybody know a way or some deocumentation how to use the stencil cli commands programmatically from a node process?
Best regards
Why ionic creat does't care about customer?
Are you an Enterprise User?
I think they are doing their best to answer everything.
Ionic3 is working, but not supported 100% anymore. You should update your Version to ionic 5. On the one side for you and for a guaranteed Support, but on the other Side for your Users too, as the latest Versions include the latest native Styles and clearly works better.
And of course you can create the native APK & IPA Files directly? For Example ionic cordova build android
builds a native Android APK.
Why npm install doesnt install angular/dev-kit
Image picker not working in Ionic 4 app
thanks. you save my day.
Unfortunately app closed in Android Image Picker plugin
follow this solution. it works for me.
https://forum.ionicframework.com/t/image-picker-not-working-in-ionic-4-app/171430