Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8705075
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T03:15:58+00:00 2026-06-13T03:15:58+00:00

This is a real simple example, I have a basic JavaScript object with an

  • 0

This is a real simple example, I have a basic JavaScript object with an array, I am using knockout mapping to make the array observable etc.

But when I apply my binding I only get undefined.

Any Ideas Why?

HTML

<div data-bind="with: Data">

    <div class="tab-pane active" id="studydirections">
        <div data-bind="template: { name: studydirectionstemplate, foreach: studydirections }">
        </div>
    </div>

</div>

<script id="studydirectionstemplate" type="text/html">
    <div> <span data-bind="text: Name"> </span> </div> 
</script>​

JavaScript

var viewModel = {};

var data = {
    studydirections: [{
        RecId: 299,
        ColtechCode: 75,
        Name: "FARM",
        Description: "FARMING"},
    {
        RecId: 306,
        ColtechCode: 12,
        Name: "BACC",
        Description: "ACCOUNTING"},
    {
        RecId: 334,
        ColtechCode: 11,
        Name: "BMAN",
        Description: "BUSINESS MANAGEMENT"
    }
]};

viewModel.Data = ko.mapping.fromJS(data);

ko.applyBindings(viewModel);​

The result is

undefinedundefinedundefined

Here is a link to a fiddle to illustrate the problem

http://jsfiddle.net/armandvdwalt/3Q267/

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T03:15:59+00:00Added an answer on June 13, 2026 at 3:15 am

    Just change, enclose template name in single quote.

    <div data-bind="template: { name: 'studydirectionstemplate', foreach: studydirections }">
    

    Check your updated jsFiddle

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm new to jQuery so this may be a real simple answer. I have
This is a real newbie question. I have simple app that selects a picture
Below I'm using simple example, real tables are bigger, I cannot store devices in
I have taken this example test before I'll try to take the real one
I think this should be simple, but im having a real hard time finding
First off, please accept my apologies if this question is basic, I mainly have
I have this very simple wrapper template: template<class T> struct wrapper { inline operator
We are using Hibernate as persistency layer and have complex object model. Without exposing
Using knockout.js, is it possible to bind to a property of a child object
This is probably a real simple question but I'm looking for the most memory

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.