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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T15:50:56+00:00 2026-06-01T15:50:56+00:00

I’ve been building a HTML (email/page) composition tool in Ember.js as a way of

  • 0

I’ve been building a HTML (email/page) composition tool in Ember.js as a way of getting my head round it, I guess it’s a sort of WYSIWYG.

A user adds various objects with different values (link, text etc.), the objects can have different templates and be arranged with jQuery UI which feeds back to the controller. What the user sees on screen is actually spot on and I am currently saving and reloading clean JSON from localstorage as a method of persistence.

What I’d really like to do though, is being able to generate a clean HTML version of what the user is seeing. Either from something written into the front end application or by processing the JSON I export on the server side.

I’d like to keep as much in JS, Ember and Handlebars as possible, and Ideally not re-implement too much of my templates/code in different places.

An example of a ‘row’ in my rendered output is below.

.row-controls is toggled on and off by a global editor toggle.

<script id="metamorph-11-start" type="text/x-placeholder"></script>
  <div id="ember507" class="ember-view template-row ui-droppable">
    <ul id="ember524" class="ember-view row-controls">
      <li class="dragger"><a href="#">drag</a></li>
      <li class="type"><a href="#" data-ember-action="19">type</a></li>
      <li class="edit"><a href="#" data-ember-action="20">edit</a></li>
      <li class="delete"><a href="#" data-ember-action="21">delete</a></li>
    </ul>
    <script id="metamorph-12-start" type="text/x-placeholder"></script>
    <script id="metamorph-13-start" type="text/x-placeholder"></script>
      <h2><a href="http://foo.com/bar" data-bindattr-34="34">
        <script id="metamorph-19-start" type="text/x-placeholder"></script>
          Link title text
        <script id="metamorph-19-end" type="text/x-placeholder"></script>
      </a></h2>
      <img src="http://foo.com/image.png" data-bindattr-35="35">
      <script id="metamorph-20-start" type="text/x-placeholder"></script>
        Teaser/synopsis
      <script id="metamorph-20-end" type="text/x-placeholder"></script>
      <a href="http://foo.com/bar" data-bindattr-36="36">Read more</a>
    <script id="metamorph-13-end" type="text/x-placeholder"></script>
    <script id="metamorph-12-end" type="text/x-placeholder"></script>
  </div>
<script id="metamorph-11-end" type="text/x-placeholder"></script>

I guess It might seem like an odd thing to be doing, with limited practical application but I’d like to finish it now I’ve started 🙂 Also, I think the principles involved in any answer could probably have different application, I just haven’t thought of it yet

Thanks! And thanks to the other people on here for answering my previous few questions about Ember.

EDIT

Just be clear, I’m talking about getting output like this

<h2><a href="http://foo.com/bar">Link title text</a></h2>
<img src="http://foo.com/image.png">
Teaser/synopsis
<a href="http://foo.com/bar">Read more</a>

SOLUTION EDIT

In case anyone finds this link – I’ve added (to my standard JS version) a check for attr within the attribute loop.

<script>
// ...
return $.each($this[0].attributes, function(index, attr) {
  // this bit added
  if(!attr) {
    return;
  }
  if (attr.name.indexOf('data-bindattr') === -1) {
    return;
  }
  // ...
</script>

It could have been an error in some other code I had going on, but jQuery was passing ‘undefined’ as attr in the loop. jQuery seems to want to resolve the whole each function so I couldn’t debug exactly what this was. The check seems to be working for me at the moment though.
Not sure how to factor into the particular original coffeescript file I’m afraid.

  • 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-06-01T15:50:57+00:00Added an answer on June 1, 2026 at 3:50 pm

    ghempton from CodeBrief talks a little about it on this awesome post: http://codebrief.com/2012/03/eight-ember-dot-js-gotchas-with-workarounds/

    Check tip 7.
    Read all of them too, its worth it.

    By the way, it’s on coffeescript the post, if you need to get the JS version go to http://coffeescript.org/ on the Try Coffeescript tab and convert it!

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a jquery bug and I've been looking for hours now, I can't
That's pretty much it. I'm using Nokogiri to scrape a web page what has
Basically, what I'm trying to create is a page of div tags, each has
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have this code to decode numeric html entities to the UTF8 equivalent character.
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
i got an object with contents of html markup in it, for example: string

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.