Learn About External Templates with KnockoutJS | John Papa

John Papa

Evangelist on the loose

Learn About External Templates with KnockoutJS


Templating is a killer feature of many technologies that helps reduce code and make it more manageable and adaptable. Knockout.js has a native template engine (or you can tie in a custom templating engine), but often I like to go a bit further and load my templates from external files. In this month’s Papa’s Perspective column in Visual Studio Magazine I cover the Knockout.js External Template Engine and how it makes using external templates with Knockout.js a breeze. Check it out.

Jim Cowart wrote this library, pushed it to github, and created a NuGet package for it, so there’s no reason not to use it Smile. Just search for “Knockout” and you will find it in NuGet. ko ps

I talk more Jim’s templating library and several ways to use templates with Knockout in my in depth Knockout course at Pluralsight. So if you want to learn more, check out Building HTML5 and JavaScript Apps with MVVM and Knockout.

tags: github knockout knockoutjs mvvm nuget Papa's Perspective pluralsight vs magazine
  • Prakash

    I miss your silverlight tutorials, any chance you gonna do some kungFu stuff on silverlight again, or possibly WinRT.

  • Ahmed Mohamed Tolba El-Dokanny

    I want to put script tag in the external Template but the script isn’t rendered; see the attached image;

  • Ahmed Mohamed Tolba El-Dokanny

    I am waiting your reply

  • Eslam Saeid

    i also have the same issue

  • johnpapa7

    Ahmed – That you for your patience. I do not embed javascript inside of templates, so I don not have any advice for you to make that work. I prefer to keep my JavaScript and HTML separated.

%d bloggers like this: