Suppose initial html code is:
<div id="first" ng-controller="IndexPageController">
</div>
After the page is loaded, it makes some ajax request and appends new html
<div id="first" ng-controller="IndexPageController">
<div id="appended">
{{data}}
</div>
</div>
My controller
MyApp.controller('IndexPageController', ['$scope', '$http', function ($scope, $http) {
$scope.data="something";
});
Since the newly created DOM element does not inherit the $scope given to its compiled template. How can i bind the dom element to the controller?