- Get angular element of div
- Use .append() method to append html to that angular element
<!DOCTYPE html>
<html ng-app="" ng-controller="myCtrl">
<body>
<button ng-click="AppendHtml()">
Append
</button>
<div id="calendarBox">
</div>
<script>
function myCtrl($scope) {
$scope.AppendHtml = function() {
var myEl = angular.element( document.querySelector( '#calendarBox' ) );
myEl.append('Hi<br/>');
}
}
</script>
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.15/angular.min.js"></script>
</body>
</html>
Posted On:
05-Apr-2019 08:51