lathonez / clicker

Ionic 2 + @angular/cli Seed Project : Angular2 + Typescript + Karma + Protractor + Travis
http://lathonez.com/2018/ionic-2-unit-testing/
MIT License
430 stars 136 forks source link

Failed: Uncaught (in promise): cordova_not_available #116

Closed srishiva89 closed 8 years ago

srishiva89 commented 8 years ago

-removed

lathonez commented 8 years ago

Not seen this before.

Could you give me a repo to clone down so I can try it myself?

lathonez commented 8 years ago

Not easy to copy and paste code like that when all the formatting has gone.

Why not make a branch for it if you don't want to commit it? Let me know the branch name and I can clone from that.

lathonez commented 8 years ago

I've tried patching the changes you've highlighted by hand and can't replicate the issue.

Please create a branch that replicates the issue for you that I can pull down.

This removes any ambiguity and saves all this back and forth. Also if others want to contribute to this issue they are easily able and everyone is on the same page.

On 5 Jul 2016 04:20, "Siva Shankar Chockalingam" notifications@github.com wrote:

only few lines you have to change. Below i bold the changes:-

labs-provider.ts:- private static URL: string = 'https://dev.diagnox.me/v2/labs/byDist?lat= https://dev.diagnox.me/v2/labs/byDist?lat=';

public getLabList(latitude: number, longitude: number): any { return this.http.get(LabsProvider.URL + latitude + '&lng=' + longitude).map(response => response.json()); }

labs.spec.ts

expect(connection.request.url).toBe( 'https://dev.diagnox.me/v2/labs/byDist?lat=20.6734434&lng=-103.3747635 https://dev.diagnox.me/v2/labs/byDist?lat=20.6734434&lng=-103.3747635 ');

provider.getLabList(20.6734434, -103.3747635);

labs.ts

Added below line: import {Geolocation} from 'ionic-native';

public ngOnInit(): any {

this.getLocation().then(position => { this.latitude = position.coords.latitude; this.longitude = position.coords.longitude; }).then(val => { this.labsProvider.getLabList(this.latitude, this.longitude) .subscribe(data => { this.labs = data.data.labs; }); }); }

// get current location

private getLocation(): any { return Geolocation.getCurrentPosition(); }

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/lathonez/clicker/issues/116#issuecomment-230337254, or mute the thread https://github.com/notifications/unsubscribe/AG5tSFYSbLsySKdJCNjkmXfpU0rFQlSEks5qSU8LgaJpZM4JEaR8 .

lathonez commented 8 years ago

@srishiva89 much appreciated i will have a look this evening.

lathonez commented 8 years ago

Seems to be a private repo.

lathonez commented 8 years ago

@srishiva89 I can't support private repositories in my own time as part of this project.

If you need your work to remain private I can provide consultancy to your organisation separately. Contact me by email to discuss.

If you don't need your work to remain private, make it public..

Further reading:

lathonez commented 8 years ago

@srishiva89 if you managed to resolve this yourself could you let us know how so it could assist future users?

If not please reopen sharing the codebase.

Thanks

lathonez commented 8 years ago

For some reason it seems #120 was opened instead of just responding on here, will leave it there.