0
ich meine Winkel app in Java dynamische Web-Projekt, Verzeichnis Karte deplying:AngularJS templateUrl in WebContent
->WebContent
---->javaScript
------>directives
index.html
und in meinen Richtlinien Ordner habe ich Form Richtlinie:
var app = angular.module('myApp');
app.directive('formDirective', formDirective);
function formDirective() {
var directive = {
restrict: 'EA',
templateUrl: 'formDirective.html', //the request
scope: {
},
controller: FormControllerDir,
controllerAs: 'vm',
bindToController: true
};
return directive;
}
function FormControllerDir() {
console.log('FormController');
}
und formDirective.html
platziert unter dem gleichen Verzeichnis, aber eckige Suche nach der Datei unter root:
GET http://localhost:8080/P2P/formDirective.html 404 (Not Found)
P2P ist mein Projekt ct Name, wie ändere ich es an:
http://localhost:8080/P2P/JavaScript/directives/formDirective.html
vielleicht fügen Sie '/' vor 'templateUrl:‚/ formDirective .html'' –
was ist mit ./formdirective.html – gianni
fast, es umleiten zu Unterordner, ja, aber das ist der Weg, Entsendung Antwort. –