Why this throws an exception?
var item = {ID: 2, Name: "Andrej" };
var html = "<div>{{ID}} - {{Name}}</div>";
$compile(html)(item); // THIS THROWS EXCEPTION
Exception is (line 764)
TypeError: jqLite("<div>").append(element).html().match(/^(<[^>]+>)/) is null
$interpolatetake scope objects?. 2) If i use$interpolateon a template string with some object or scope object as context, will the template updates as i change that context? +1 for the distinction bw$compileand$interpolate. Sorry i could not use "@Andy Joslin" in answer section. SO is automatically removing it