problem about template-engine-Collection of common programming errors


  • Vittorio Vittori
    javascript design-patterns backbone.js template-engine
    I’m trying understand how to work with Backbone collections and to pull them inside the relative template engine created by a sub view.This is the logic i tried in my app:My ajax request returns me this object:{“products”:[{“id”:”43″,”text”:”Sunset Chips”,”image”:”43.png”},{“id”:”107″,”text”:”Pringles Hot & Spicy”,”image”:”107.png”}],”brands”:[{“id”:”132″,”text”:”P&G”,”image”:”132.png”},{“id”:”27″,”text”:”Kinder”,”image”:”27.png”}] }I grab it with jQuery’s $.ajax method and manage it for my Backbone app here in my view:var search = {};search.app = {}; search.app.id = “#search-results”;search.product = {}; search.product.defaults = {id:0,text:””,image:”files/product/default.png”, };$(function(){var SearchApp = new Search.Views.App({id:”#search-results”});var ProductList = new Search.Collections.Products();var subView;function parseResults (response, search) {for (var i = response.products.length – 1; i >= 0; i–) {ProductList.add([new Search.Models.Product(response.products[i])]);};subView = new Search.Views.Product ({collection:ProductList,id:”#product-results”,template:”#results-product-template” // solo

  • yckart
    jquery regex replace template-engine str-replace
    I’ve written some days ago a simple templating function, problem now is that whitespace will kill the tag. So when I type something like this: #{my} #{name} #{is} #{#{a}} it works well, how

  • joshontheweb
    javascript node.js express template-engine
    I am trying to get plate template engine to work with express.js. My initial attempt was this:app.register(‘.html’, {compile: function (str, options) {var template = new plate.Template(str);return function(locals) {return template.render(locals, function(err, data) {return data;});}} });I see that the problem is that template.render doesn’t return anything (undefined) but passes

  • user1147941
    javascript templates knockout.js template-engine
    I’d like to display a value within data as a link, and pass a custom function to it’s click event (which will eventually display a modal w/ status history).I have properties “isLink” (bool) and “onClick” (function), which can look like the following:{ headerText: “ColumnName”, row

  • ReneHH
    templates freemarker template-engine
    In a list I want to incorporate a if host.machine == 1 then action=Set else action=CreateI want the following output Type:Machine;Action:Set;Attributes[Name:machine1~NodeManager.ListenAddress:10.104.17.70~NodeManager.ListenPort:5558]
    Type:Machine;Action:Create;Attributes[Name:machine2~NodeManager.ListenAddress:10.104.17.71~NodeManager.ListenPort:5558]
    My datahosts:[{“name”: “trfuoemlpa004v”, “node”: 0, “server”: 1, “

  • Adam
    javascript coffeescript template-engine coffeekup
    I have an options object in my CS class, and I’d like to keep some templates in it:class MyClassoptions:templates:list: ”

      “listItem: “

    • #{ foo + bar }
    • “# etc…Then I’d like to inte


    • user1131522
      template-engine dwoo
      I am using a DWOO template engine and need to force it to recompile view templates on every page refresh. There is no documentation on that, but from some forum pos

    • pkyeck
      node.js template-engine express ejs
      i’m using the EJS template engine with nodejs/express and i’m wondering if it’s possible to add another css or js file in e.g the index.ejs (not

    • Daryl Spitzer

    • nicholas.alipaz

    • David Eyk

    • Eran Medan
      javascript template-engine
      I was looking for a JavaScript template engine, and chose DoT.js (mostly because it’s very fast) but had the following issues Null safe/Undefined safe/null-coalescing, Just like in Freemarker / VTL, I want to be able to pass foo.bar.foobar and not worry about checking foo, foo.bar and foo.bar.foobar

    • Asherlc
      ruby-on-rails ruby-on-rails-3 template-engine liquid
      I’m getting an Liquid error: undefined method ‘to_liquid’ for # error on my Email object when sending an email using a Liquid template inside a view. However, when I render the view by itself in the browser, it works just fine!Here’s my view:= raw @t

    • Mike Sherov

    • Flexo
      javascript node.js template-engine swig-template
      I’m trying to switch from Jade to Swig (lured by Swig’s insane performance) as my Express template engine when I got stuck here — I’m sending an array of serialized JSON from Express into Swig and retrieve the data in Swig using this loop here:

        {% if items %}{% for item in items %}{{ J

    • Willshaw Media

    Originally posted 2013-11-09 20:50:56.