string array in data template

2 posts, 0 answers
  1. Richard
    Richard avatar
    1 posts
    Member since:
    Aug 2012

    Posted 16 Aug 2012 Link to this post


    I have created a simple datasource wich gets a string array from a service.
    The data that the service returns is in jsonp format.
    The data the datasource returns is correct when i debug the code with chrome,
    but i cant get it working with a datatemplate.

    this is my code of the data-template:
    <input type="checkbox"/>#: this#

    but when i try to show this, I get a list of [Object] object.

    How can I get the string value out of this object?

    this post: 
    showed that it can be done with "this", but thats what im doing right now.
  2. Charles Benoualid
    Charles  Benoualid avatar
    26 posts
    Member since:
    Sep 2009

    Posted 06 May 2013 Link to this post

    you need to use

    <span data-bind="text: this"></span>
Back to Top