Coder Social home page Coder Social logo

Comments (9)

heapwolf avatar heapwolf commented on June 12, 2024

This is good and bad. In some cases you want to simply insert the new value (possibly at the start, or at the end) and in some cases you want to overwrite. i've been thinking about this. i had an option that looked like this...

  var html = '<span></span><img id="bar" class="foo bazz" src=""/>';
  var data = { "bazz": "Hello, World" };

  //  var options = { "bazz": ["class", "src", "overwrite"] };
  //  var options = { "bazz": ["class", "src", "append"] };
  //  var options = { "bazz": ["class", "src", "prepend"] };

  //
  // the following would be possible since this these are not valid attribute names, 
  // but it is what has me up in the air about implementing a solution.
  //
  //  var options = { "bazz": ["class", "prepend"] }; 

  var output = Plates.bind(html, data, options);

from plates.

jfhbrook avatar jfhbrook commented on June 12, 2024

Making this configurable sounds good, but can we make the default be overwriting?

from plates.

reid avatar reid commented on June 12, 2024

I'd like to see overwriting be the default.

Right now, the README demos bind with "Old Value" in the HTML and "New Value" in the data object, which is confusing — the output would be "Old ValueNew Value".

from plates.

Phoscur avatar Phoscur commented on June 12, 2024

atm the output actually is "New ValueOld Value", it should overwrite by default. Could you please fix this? Using the npm release.

from plates.

heapwolf avatar heapwolf commented on June 12, 2024

lol. i thought someone did this already. i'll do by tomorrow sometime.

from plates.

Phoscur avatar Phoscur commented on June 12, 2024

Still not fixed!
But nice new fancy stuff :D

from plates.

heapwolf avatar heapwolf commented on June 12, 2024

huh?

from plates.

Phoscur avatar Phoscur commented on June 12, 2024

My bad, didn't upgrade correctly. Sorry.

from plates.

heapwolf avatar heapwolf commented on June 12, 2024

=)

from plates.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.