각도 응용 프로그램을 로컬로 실행할 수 없습니다. 내 interview.js와 angular.js가 발견되지 않는다는 오류가 나타납니다. 또한, 각도는 ide 콘솔에서 열 때 interview.js 파일에 정의되어 있지 않습니다. 여기 각도 응용 프로그램을 로컬로 실행할 수 없습니다.
mock
public
index.html
src
services
interview.js
vendor
angular.js
가 내 index.html을 여기에
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<title>Interview Practice</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="../vendor/angular.js" type="text/javascript"></script>
</head>
<body ng-app="interviewapp">
hello world!
<script src="../src/interview.js" type="text/javascript"></script>
</body>
</html>
내가 HTTP 서버를 내 interview.js
angular.module("interviewapp", []);
console.log("does this work");
사용하고 있습니다 : 여기
내 디렉토리 구조 응용 프로그램을 시작합니다.Starting up http-server, serving ./public
Available on:
http://10.66.87.184:8080
http://192.168.56.1:8080
http://127.0.0.1:8080
이, 내가 오류입니다 localhost로가는, 또는 거기에 열거 된 HTTPS 중 하나를
http://10.66.87.184:8080/vendor/angular.js Failed to load resource: the server responded with a status of 404 (Not Found)
http://10.66.87.184:8080/src/interview.js Failed to load resource: the server responded with a status of 404 (Not Found)
어떻게이되도록 내 응용 프로그램이 실행 수정합니까?
'src'와'vendor' 디렉토리를'public' 디렉토리로 옮기고 파일의 경로 시작 부분에서'..'를 제거하십시오. 'src = "../ src/interview.js"''를'src = "/ src/interview로 변경하십시오.js "' –
cdn을 앵귤러에 연결하고 src 폴더에 대해 말한 내용을 수행했습니다. 왜 그 것이 효과가 있었는지 말할 수 있습니까? – McFiddlyWiddly
설명이있는 답변이 추가되었습니다. –