I'm trying to bind a <p> with an <input> in my application, but it is not happening. since both elements are dynamically created, I thought maybe I can use $apply, but it didn't work out. everything else is functioning as expected except for this.
My code is a bit complicated, so here is a plunker to demonstrate my situation.
HTML:
<body ng-app="tata" ng-controller="mainController">
<div id="main">
<div ng-controller="ctrl1">
<button ng-click="changeCard()">Add Dynamic Bound Elements </button>
<page id="front" size="A4"></page>
<div id="detailsFront"></div>
</div>
</div>
</body>
The elements are generated using 2 functions, on for INPUT and the other for P. Here is where the inputs are placed:
<div id="detailsFront">
</div>
and here where the ps are placed:
<page size="A4" id="front">
</page>
The controller responsible for this view has 2 functions which are run successively in the same $scope function. Populating <p>s:
buildPDF : function (parentElement){
var element = angular.element(document.getElementById( parentElement ));
ele = "<p ng-bind='id7'> Test Run </p>";
element.append(ele);
}
element.append(ele);
Then the inputs:
buildPDFControllers : function (parentElement){
var element = angular.element(document.getElementById( parentElement ));
ele = "<label for='id7'>Some Label</label> <input name='id7' type='text' ng-model='id7'>";
element.append(ele);
}

$compile(stuff)(scope);and maybe you should use directives. And plunker would be nice.