I have the following code:
app.directive('mySample', function($compile) { return { //template:"<input type='text' ng=model='sampleData'/> {{sampleData}} <br/>" link: function(scope, element, atts, controller) { var markup = "<input type='text' ng=model='sampleData'/> {{sampleData}} <br/>"; angular.element(element).html($compile(markup)(scope)); console.log($compile(markup)(scope)); } }; });
And I expect it to generate input, some range, connected through the scope and break. However, I get this output:
[[object HTMLInputElement], [object HTMLSpanElement], [object HTMLBRElement]]
I also tried the template, in a comment here, separately, and then commenting out part of the link. This generates input and fault elements, but not a range that shows the associated SampleData input model.
I have a non-working sample at http://jsfiddle.net/KvdM/nwbsT/ that demonstrates it.
source share