ionic-team / ionic-starter-super

The Ionic 2 Super Starter 🎮

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

search is deprecated

pkitatta opened this issue · comments

image

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

What exactly?
Why is search stikethrough in your IDE?

It says it is deprecated.

What exactly? The search property of options?

Here is the code you screenshotted:

options.search = !options.search && p || options.search;

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.

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

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

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.

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

4.1.3

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.

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?

The API calls get the endpoint as a param, like here:

return this.api.get('/items', params)

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?

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

Aright, thanks for your help.