2017-08-17 1 views
0

Ich versuche, eine AngularJS App zu machen .Aber ich diesen Fehler:Fehler beim Instanziieren der Modul-App aufgrund von AngularJS?

Failed to instantiate module app due to

ist hier mein Code:

<html> 
<head><title>New Version!</title> 
</head> 
<body ng-app="app"> 
<div ng-controller="appcontr"> 
    <ul> 
     <li>A new XSLT engine is added: Saxon 9.5 EE, with a namecense (thank you Michael Kay!)</li> 
     <li>XSLT 3.0 support when using the new Saxon 9.5 EE engine!</li> 
     <li>Preview your result as HTML when doctype is set to HTML (see this example)</li> 
     <li>Preview your result as PDF when doctype is set to XML and your document starts with root element of XSL-FO. 
      Apache FOP is used to generate the PDF 
     </li> 
     <li>Added some namenks to useful XSLT sites</li> 
    </ul> 
</div> 
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.4.5/angular.js"/> 


<script> 
    angular.module('app', []).controller('appcontr', appcontr) 
    function appcontr($scope) { 
     $scope.name = 'dd' 
    } 

</script> 

</body> 
</html> 
+0

Hast du einen Grund für das Scheitern zu instanziieren? –

+0

Wegen ** was **? Fehlermeldung enthält die Information zu dem, was falsch ist, und es wurde in der Frage weggelassen. Es kann durch ** etwas ** behoben werden. – estus

+0

'Uncaught Error: [$ injector: modulerr] Fehler beim Instanziieren der Modul-App aufgrund von: Fehler: [$ injector: nomod] Modul 'app' ist nicht verfügbar! Sie haben entweder den Modulnamen falsch geschrieben oder vergessen, ihn zu laden. Wenn Sie ein Modul registrieren, stellen Sie sicher, dass Sie die Abhängigkeiten als zweites Argument angeben. " – georgeawg

Antwort

0

Es funktioniert gut, nur das Skript Referenz schließen wie folgt:

<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.4.5/angular.js"> 
</script> 

DEMO

angular.module('app', []).controller('appcontr', appcontr) 
 
    function appcontr($scope) { 
 
     $scope.name = 'dd' 
 
    }
<html> 
 
<head><title>New Version!</title> 
 
</head> 
 
<body ng-app="app"> 
 
<div ng-controller="appcontr"> 
 
<h1> {{name}}</h1> 
 
    <ul> 
 
     <li>A new XSLT engine is added: Saxon 9.5 EE, with a namecense (thank you Michael Kay!)</li> 
 
     <li>XSLT 3.0 support when using the new Saxon 9.5 EE engine!</li> 
 
     <li>Preview your result as HTML when doctype is set to HTML (see this example)</li> 
 
     <li>Preview your result as PDF when doctype is set to XML and your document starts with root element of XSL-FO. 
 
      Apache FOP is used to generate the PDF 
 
     </li> 
 
     <li>Added some namenks to useful XSLT sites</li> 
 
    </ul> 
 
</div> 
 
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.4.5/angular.js"> 
 
</script> 
 
</body> 
 
</html>

+0

könnten Sie bitte weitere Informationen geben und bitte liefern Sie – user5711656

+0

welche Referenz? – user5711656

+0

@ user5711656 Überprüfen Sie die Demo, ihre angular.js Referenz – Sajeetharan

Verwandte Themen