flatiron / plates

Light-weight, logic-less, DSL-free, templates for all javascript environments!
MIT License
831 stars 69 forks source link

Config for ignoring undefined attributes #100

Closed johngeorgewright closed 9 years ago

johngeorgewright commented 11 years ago

Hey there,

I've written a possible solution to task #95.

Now attributes can be ignored when they are undefined in 3 ways.

  1. By setting the ignoreEmpty option to true:

    Plates.Map({
     create: true,
     ignoreEmpty: true
    });
  2. By specifying a particular attribute:

    Plates.Map({
     create: true,
     ignoreEmpty: 'id'
    });
  3. By selecting a few attributes with an array:

    Plates.Map({
     create: true,
     ignoreEmpty: ['id', 'data-toggle']
    });
johngeorgewright commented 9 years ago

Nearly 2 years old. Closing.