0

I have problem with this Typeerror. I'm a novice and I wasn't able to find the solution of this problem.

TypeError: Property 'currentPage' of object [object Object] is not a function

The code is here: https://gist.github.com/Jirda/8852736

Thank you for your feedback.

1 Answer 1

1

in this line (line no. 14 in your code)

self.goNextPage = function() {
                self.load(self.currentPage() + 1, self.limit);
            }

you are trying to use self.currentPage() with (), i.e. , you are trying to invoke the property as a function, which is not allowed, hence the error.

just use:

self.goNextPage = function() {
                    self.load(self.currentPage + 1, self.limit);
                }

EDIT:

in self.currentPage(data.currentPage) also, you are using it with braces

Sign up to request clarification or add additional context in comments.

4 Comments

I fix it but the error is reported here all the time self.currentPage(data.currentPage);
BTw. that fixed row reports the error too. Brackets doesn't matter.
you have used the braces in many places in the program. are you sure the error is not because of this ?
the problem was in the template - there I used a name without brackets...and when observable variable was changed, the error was thrown

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.