ionic-team / ionic2-starter-aws

Ionic + AWS MobileHub Starter Project
235 stars 47 forks source link

Scope bugs when running app in Google Chrome. #20

Closed jamey-taylor closed 7 years ago

jamey-taylor commented 7 years ago

I get "this.isAuthenticated is undefined" after login and "this.refreshTasks" is undefined after adding a task. To fix my local copy, I changed the callback to a typescript fat arrow in user.ts line 36 and tasks.ts line 78.

jamey-taylor commented 7 years ago

Sure thing! Here's what I did on my local:

user.ts 36: 'onSuccess': (result) => { tasks.ts 78: }, (err, data) => {

On Thu, Jun 22, 2017 at 10:02 AM, chadamodio notifications@github.com wrote:

Do you have the code that fixed this.refreshTasks error? Thanks in advance.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ionic-team/ionic2-starter-aws/issues/20#issuecomment-310407335, or mute the thread https://github.com/notifications/unsubscribe-auth/AC1jVfkVa5uhR60ztU3dqv957zOJxwjiks5sGoIHgaJpZM4N7mrI .

chadamodio commented 7 years ago

much easier than my changes! thanks

kopahead commented 7 years ago

I am getting ionic this.refreshTasks is not a function on chrome after creating a task. When I refresh the page I can see the task though

Any one else came across this?

chadamodio commented 7 years ago

@kopahead change the code shown in @jamey-taylor response. It fixed the issue for me.

mlynch commented 7 years ago

Should be resolved in PR #21, thanks!