Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

283
Views
TypeError no detectado: this.firstname no es una función

Estoy estudiando knockout js y ocurrió un error ¿cuál es el problema?

 <span data-bind="text: fullname"></span> <script type="text/javascript"> function AppViewModel() { this.firstName = ko.observable('Bob'); this.lastName = ko.observable('Smith'); this.fullname = ko.computed(function() { return this.firstname() + " " + this.lastname(); },this); } // <!-- ko.applyBindings(viewModel); --> var vm = new AppViewModel(); ko.applyBindings(vm); </script>

cuando llamo esto,

 Uncaught TypeError: this.firstname is not a function

pasar... que pasa?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

A

 return this.firstname() + " " + this.lastname();

No escribiste con mayúscula la "n" en firstname y lastname . Así que prueba algo como esto:

 function AppViewModel() { this.firstName = ko.observable('Bob'); this.lastName = ko.observable('Smith'); this.fullname = ko.computed(function() { return this.firstName() + " " + this.lastName(); },this); } // <!-- ko.applyBindings(viewModel); --> var vm = new AppViewModel(); ko.applyBindings(vm);
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!