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

  • SEARCH
  • Home
  • 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 7502927
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T21:02:55+00:00 2026-05-29T21:02:55+00:00

I am trying out the great new containerless control flow (new feature number 2)

  • 0

I am trying out the great new containerless control flow (new feature number 2) at Knockout 2.0.0 released or http://jsfiddle.net/StevenSanderson/8vms5/light

<ul>
    <li><strong>Here is a static header item</strong></li>
    <!-- ko foreach: products -->
    <li>
        <em data-bind="text: name"></em>
        <!-- ko if: manufacturer -->        
           &mdash; made by <span data-bind="text: manufacturer.company"></span>
        <!-- /ko -->
    </li>
    <!-- /ko -->
</ul>

What if i wanted something like < li class=”${ name }”>< /li>

This was trivial while using templates, but i cannot make it work right now.
i tried < li data-bind=’class: name’>< /li> but in vain.

I’m new here, please go easy on me.

  • 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-05-29T21:02:57+00:00Added an answer on May 29, 2026 at 9:02 pm

    You can use the css binding. It can be used two ways. Either with a dynamic class (or list of classes):

    <li data-bind="css: name"></li>
    

    or with individual classes bound against truthy/falsy values to indicate whether that are should be added/removed from the element:

    <li data-bind="css: { classOne: hasClassOne, classTwo: hasClassTwo }"></li>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying out the debugger built into Zend studio . It seems great!
I'm having a great deal of difficulty trying to figure out the logic behind
Trying out the examples found on pleac.sf.net , I'm not able to get an
I'm trying out ASP.NET MVC routing and have of course stumbled across a problem.
I'm trying out log4j in a simple test app. I create a new Java
I'm quite new to subsonic and I am trying to do an almight great
Am new to RoR paperclip gem and i have been trying out some examples
I'm trying out Generics and I had this (not so) great idea of creating
I am stumped I am new to jQuery and trying to figure out what
I'm trying to figure out a way to count the number of characters in

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.