Angular, when loading another page with ajax inside the page does not allow me to use angular

0

I have a page where I use a lumx framework that is based on angular, everything works perfect. The problem is that in one of the options I charge a div with content from another page through ajax. And it is on that page that I can not use the framework and neither is it angular, since I try to put a simple button and the ng-click event and it does not work either.

I'm lost and I do not know what to do.

<html ng-app="lumx-demo">
<head>

....

<!--  Aqui en un momento dado se carga la pagina por ajax-->
<div id="graficaEstudio">grafica estudio</div>

........

<script src="js/lumX-1.7.7/demo/app.js"></script>
<script src="js/lumX-1.7.7/demo/js/demo/layout/js/layout_service.js"></script>
<script src="js/lumX-1.7.7/demo/js/demo/main-nav/js/main-nav_directive.js"></script>
<script src="js/lumX-1.7.7/demo/js/demo/main-nav/js/main-nav-link_directive.js"></script>
<script src="js/lumX-1.7.7/demo/js/demo/component/js/component_directive.js"></script>

I do not know if the problem would be in that angular charge before without the page that is loaded by ajax and then I have to reload something.

I have tried on that page that I'm charging ajax to put a simple example that works for me and neither does it take it and it does not give an error.

<input type="button" value="carga"  ng-app="ngClickExample" ng-controller="test" ng-click="foo()">
<script>
    (function(angular) {
        'use strict';
        angular.module('ngClickExample', [])
            .controller('test', function($scope) {
                $scope.foo = function(){
                    alert('bar');
                }
            });
    })(window.angular);
</script>
    
asked by sergio hernandez 08.05.2018 в 19:45
source

1 answer

0

You can not load a page by ajax, it is not appropriate, the ajax is used to send information and choose data type json, xml, etc .. if you want to show the page redirects to it

    
answered by 08.05.2018 в 22:29