ionic3

Ionic 2 http.get() issue

点点圈 提交于 2019-12-07 20:13:10
问题 I tried to make a http.get() call with these two methods. First: getResults(){ return this.http.get('http://localhost/api.php') .toPromise() .then( data => data.json() ); } Error Shown: 3 122412 error EXCEPTION: Uncaught (in promise): Response with status:0 for URL: null 4 122413 error ORIGINAL STACKTRACE: 5 122413 error Error: Uncaught (in promise): Response with status: 0 for URL: null .......... Second: getResults(){ return new Promise((resolve, reject) => { this.http.get('http://localhost

ionic 3 deeplinking for reset password

安稳与你 提交于 2019-12-07 17:39:27
I am creating a mobile application using ionic 3. I need to know the logic to implement reset password functionality. till now, i am able to send an email with reset token to the user. I was thinking that id user clicks on the link in the email, if app is installed then it should open the application page dedicated for reset password. So i did a little research and found that it can be done using DeepLinking ( custom url to respond) like myApp://resetPassword/{token} Now the problem is in gmail when you send link with custom url, it removes the href option. Can some one tell me slight

How can I draw a line between two google map native markers? (Ionic 3, cordova)

六眼飞鱼酱① 提交于 2019-12-07 16:39:39
问题 How can I draw a line between two google maps native markers? In my project, I need one dynamic marker and one fixed marker. addMarker() { this.map.addMarker({ title: 'My Marker', icon: 'blue', animation: 'DROP', position: { lat: this.place.lat, lng: this.place.lng } }) .then(marker => { marker.on(GoogleMapsEvent.MARKER_CLICK).subscribe(() => { alert('Marker Clicked'); }); }); } 2nd marker: addMarker2() { this.map.addMarker({ title: 'My Marker', icon: 'blue', animation: 'DROP', position: {

Ionic 2 Multiple Checkboxes with FormBuilder

风流意气都作罢 提交于 2019-12-07 14:07:07
问题 Survey app checkbox photo I currently faced the issue of building the form on multiple choice questions. At this moment, the form for single choice works well, only left multiple choice questions. The goal I want to have is something like this: { "questions": [ // if multiple choices question { "question_id": 17, "answer_ids": [81,82,83] }, { "question_id": 20, "answer_ids": [101,102,104] } ] } survey.ts this.surveyForm = this.formBuilder.group({ questions: formBuilder.array([]) }) for (var i

How to know the request progress in each http request in Ionic and Angular

大兔子大兔子 提交于 2019-12-07 12:08:52
问题 I don't have any code to show in this question. I am trying to google for it if there is someone who already created this feature with documentation. I also tried to find if someone already asked this question but didn't have that much luck. This is similarly to file download and upload with progress bar but that only works on file uploads/downloads but how can I dot it in just basic any post/put/delete request to the backend. So the end goal is I want to had a progress bar for each post and

Ionic - Scroll to elements of a page [duplicate]

妖精的绣舞 提交于 2019-12-07 11:17:34
问题 This question already has answers here : How to scroll element into view when it's clicked (6 answers) Closed 2 years ago . I have a terms page in which included links on the top. The purpose of these links is to scroll to page element that belongs to. Is there any way to do this dynamically from the component? 回答1: Eventually there is a scrollTo() method that give you the ability to scroll to any coordinates you want. In my component I have use the method like this: export class

Custom 404 page Ionic 3

余生颓废 提交于 2019-12-07 10:15:31
问题 I am trying to redirect from an unknown path written down by a user to a custom 404 page: For example: /login goes to login page /main goes to main page {unknown-path} goes to 404 export const deepLinkConfig: DeepLinkConfig = { links: [ { component: HomePage, name: "Home", segment: "" }, { component: LoginPage, name: "Login", segment: "login", defaultHistory: [HomePage] }, { component: SubscribePage, name: "Signup", segment: "signup", defaultHistory: [HomePage] }, { component:

Why observable.subscribe works only from constructor

ⅰ亾dé卋堺 提交于 2019-12-07 09:25:14
问题 While working on Ionic 3 app I have faced problem that when you subscribe to observable from service in ngOnInit and update a local variable into it, it does not update the view. For e.g HTML template <p>{{myVariable}}</p> constructor(myService: MyService) { } ngOnInit() { this.myService.myObservable.subscribe((data) => { this.myVariable = data; }); } But when you do same thing from constructor, it works. contructor(myService: MyService) { this.myService.myObservable.subscribe((data) => {

Ionic 3 :Type 'any' is not a constructor function type

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-07 09:22:56
问题 I had my ionic 2 project in my linux mission when i coped and moved to the mac which has ionic 3. So i created a new project and replaced the pages, provides, components folder with the new project i was getting error like cannot find module "ionic-native" after importing my plugins into app.modulte.ts file i am getting as error as 'Type 'any' is not a constructor function type.` my terminal shows 17:39:48] typescript: node_modules/@ionic-native/app-version/index.d.ts, line: 25 Type 'any' is

Multiple HTTP Requests with RxJS, with parameters

不想你离开。 提交于 2019-12-07 07:47:26
I call this api https://jokerleb.com/wp-json/wp/v2/ads/ I grab the id of each ad and then I append it to this url https://jokerleb.com/wp-json/wp/v2/media?parent=24385 My code is loadAds() { let i = 0; this.HttpClient.get(ENV.site_url + ENV.ads_url) .subscribe(res => { this.ads = this.ads.concat(res); this.HttpClient.get(ENV.site_url + ENV.ads_thumb_url + this.ads[i].id + "&&ads/" + this.ads[i].id) .subscribe(res => { this.items = this.items.concat(res); console.log(ENV.site_url + ENV.ads_thumb_url + this.ads[i].id + "&&ads/" + this.ads[i].id); i++; }) } ) } The code works but: I end up with