JSFiddle - React, Tailwind, and code Playground

by telizpablo

HTML

<!-- LINKS QUE PRECISO INCLUIR NA PAGINA APOS ELA CARREGAR (PDFjs)-->

<link rel="stylesheet" href="http://localhost/pdf.js/viewer.css"/>
      <script src="http://localhost/pdf.js/compatibility.js"></script>
      <link rel="resource" type="application/l10n" href="http://localhost/pdf.js/locale/locale.properties"/>
      <script src="http://localhost/pdf.js/l10n.js"></script>
      <script src="http://localhost/pdf.js/pdf.js"></script>
      <script src="http://localhost/pdf.js/debugger.js"></script>
      <script src="http://localhost/pdf.js/viewer.js"></script>

JavaScript

//DIRETIVA
app.directive("packpdf", function ($window, $rootScope) {
                return {
       restrict: 'E',
       // template: ('<iframe style="width:700px;height:400px;float:left" class="packpdf" src="/pdf.js/viewer.html"></iframe>')
     templateUrl: view.path('../pdf.js/viewer')
         };
   
});

//CONTROLLER
// tentativa de fazer o controler esperar a pagina carregar para chamar os scripts
function PdfjsController($scope) {
        setInterval(function () {
        	var data =  '<script src="http://localhost/pdf.js/compatibility.js"></script>'+
        '<link rel="resource" type="application/l10n" href="http://localhost/pdf.js/locale/locale.properties"/>'+
        '<script src="http://localhost/pdf.js/l10n.js"></script>'+
        '<script src="http://localhost/pdf.js/pdf.js"></script>'+
        '<script src="http://localhost/pdf.js/debugger.js"></script>'+
        '<script src="http://localhost/pdf.js/viewer.js"></script>';
        	angular.element('head').append(data);
	        $scope.$digest();
	        console.log('digest');
		},3000);     
 console.log('scoppp');
}