>
> I would relax a little on the staunch separation of the languages myself.
> I actually like to put everything in one file...
>
Well, here is what I have now, and I am *not* liking it:
//HTML in JS:
form_html += '<input type=\"button\" value=\"First\"
onclick=\"generateTableForIndex(' + 0 + ');\">';
//draws HTML table with data according to the passed index
function generateTableForIndex(index)
{
// pull JSON string from HTML, where JSON was prepared from a PHP object
var json_object = eval("(" + document.getElementById(
"json_encoded_php_object").innerHTML + ")");
if (json_object[index].product.selected) {
var flag = "Standard";
if (json_object[index].flag == 'P')
flag = "Premium";
table_html += '<TABLE>';
table_html += '<TR>';
table_html += '<TD>Flag</TD>';
table_html += '<TD>' + flag + '</TD>';
table_html += '</TR>';
table_html += '</TABLE>';
}
//from JS back to HTML
document.getElementById('table_with_data').innerHTML = table_html;
}
Hence I'm looking into Angular to see how it does things while gently
forcing you to use layer separation.
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.