I am trying to execute some JavaScript code after the HTML content has been loaded.
var gifApp = angular.module('gifApp', []);
function MainCtrl ($scope) {
$scope.push = function() {
$("body").html("<div>{{ 1 + 1 }}</div>")
}
}
When the push
function is called, {{ 1 + 1 }}
gets displayed on the screen instead of 2
. I would like for it to display the correct result. Is there a way to compile the code after the window finishes loading? If so, how can I resolve this issue?