I got this code that calls a method and returns a partial view:
var rendered = false;
$("#quicktodo").click(function () {
if (!rendered) {
$.ajax({
url: '/Home/GetTodoPartial',
dataType: 'html',
success: function (data) {
$('#_qtd').html(data).hide().slideDown('400');
rendered = true;
}
});
} else {
$('#_qtd').html("");
rendered = false;
}
});
The data
is a partial view that looks like this:
<div ng-app>
<div ng-controller='HelloController'>
<p>{{greeting.text}}, World</p>
</div>
</div>
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.22/angular.min.js"></script>
<script>
function HelloController($scope) {
$scope.greeting = { text: 'Hello' };
}
</script>
My problem is that the Angular dont seem to work in my partial-view, any suggestions on why? Thanks!