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 7130083
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T11:18:44+00:00 2026-05-28T11:18:44+00:00

Quite a few examples I see of using knockout when showing a list of

  • 0

Quite a few examples I see of using knockout when showing a list of items makes use of a separate named template versus embedding the template inside the HTML element that encloses the entire list (div, ul, etc). Is this considered a best practice or a just a style thing? My question assumes there is no need for reuse of the template (in which case separating it out is obvious).

  • 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-28T11:18:44+00:00Added an answer on May 28, 2026 at 11:18 am

    The ability to use anonymous templates (children of the element) was just added in Knockout 2.0 with the inclusion of a native template engine. It was released in December 2011, so many examples that you encounter were likely created before it was available.

    There are a few reasons why named templates are still valuable:

    • allows you to reuse templates (as you mentioned)
    • allows you to pull in a template externally (several ways to do it, but best is using: https://github.com/ifandelse/Knockout.js-External-Template-Engine).
    • the elements in a script tag will not be rendered prior to applying bindings, so you don’t have to worry about hiding the elements initially and showing them after bindings are applied.
    • allow you to use other template engines (support for the deprecated jQuery Templates plugin is included), as anonymous templates only work out-of-the-box with the native template engine.

    I think that it is helpful to use named templates for major sections of a page and then use the anonymous templates within the main template to keep it simple and clean.

    So, really it is just personal preference at this point. Generally, I find it easier to read and write the anonymous templates.

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

Sidebar

Related Questions

I've seen on the internet quite a few examples of binding a boolean to
I've seen quite a few references to the Microsoft.Web.Mvc.Controls namespace in MVC examples, but
I've been reading through quite a few articles on the 'this' keyword when using
I have a quite small list of numbers (a few hundred max) like for
God, Linq confuses me... I've found quite a few examples that do similar things
I have quite a few lines of code that create objects and using various
As I'm learning WPF I came across quite a few examples, but mostly all
Quite a few comments to answers in a different post, Where are the best
Quite a few apps support plugins. Are there any downsides to having a large
Found quite a few links related but nothing in the area of how I

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.