ionic-team / ionic-starter-super

The Ionic 2 Super Starter 🎮
Other
376 stars 142 forks source link

search is deprecated #134

Closed pkitatta closed 7 years ago

pkitatta commented 7 years ago

image

Hi wont this issue affect the outcome? Currently I have removed it from the code.

janpio commented 7 years ago

What exactly? Why is search stikethrough in your IDE?

pkitatta commented 7 years ago

It says it is deprecated.

janpio commented 7 years ago

What exactly? The search property of options?

Here is the code you screenshotted: https://github.com/ionic-team/ionic-starter-super/blob/b75cf773e430da0f1d4837926b064448bc9f88cb/src/providers/api/api.ts#L29

So options are RequestOptions from @angular/http. Can you go into there and see what exactly it says?

In general: Deprecated only means that it will be removed in the future. For you, using the code right now, this is no problem at all.

pkitatta commented 7 years ago

Yes the search property of options

Deprecated symbol used, consult docs for better alternative less... (Ctrl+F1) Checks for using deprecated JavaScript functions and variables . The validation works in JavaScript, html, or jsp files

janpio commented 7 years ago

So what do the @angular/http docs or code say about alternatives?

pkitatta commented 7 years ago

I doesn't When I click on the search word, that's what I get. I am using webstorm and I am not so advanced. Maybe it's just an IDE thing.

janpio commented 7 years ago

Which version of @angular/http are you using? Should be in packages.json.

pkitatta commented 7 years ago

4.1.3

janpio commented 7 years ago

So this is probably it: https://github.com/angular/angular/blob/72c7b6edea39f6591463c2a22eb24d087fd756b7/packages/http/src/base_request_options.ts#L60-L71

As this is still present in the current version of Angular 4.4.x you are definitely fine using that in 4.1.3.

Some time in the future this .search should probably be replaced with .params, but one would have to look deeper how exactly.

pkitatta commented 7 years ago

BTW good starter app. It's bringing me up to speed with ionic-angular.

I request your help with my endpoints.

My api endpoint is http://watsapp.dev/event so I added this to url: string = 'https://watsapp.dev; but am not sure how I should deal with this: return this.http.get(this.url + '/' + endpoint, options); with respect to my endpoint which is: http://watsapp.dev/event

Any help?

janpio commented 7 years ago

The API calls get the endpoint as a param, like here: https://github.com/ionic-team/ionic-starter-super/blob/b75cf773e430da0f1d4837926b064448bc9f88cb/src/providers/items/items.ts#L16

pkitatta commented 7 years ago

I am at the api.ts file itself and trying to connect to my laravel api end point.

I added event to get(event: string, params?: any, options?: RequestOptions) {.and then return this.http.get(this.url + '/' + event, options); Is this correct?

janpio commented 7 years ago

No. Please ask these really basic questions at the Ionic community forum: https://forum.ionicframework.com/

pkitatta commented 7 years ago

Aright, thanks for your help.