나는 이것이 좋은 Stackoverflow 질문으로 간주되지 않을 거라는 것을 알고 있지만, 나는 이것이 작동하지 않는 이유를 알아낼 수 없다. (나는 Angular's own tutorials을 기반으로한다.) 나는 아무에게도 물어 보지 않는다.내 간단한 Angular.js 앱이 왜 작동하지 않습니까?
브라우저에서 HTML을 열고 있습니다. 파일은 다음과 똑같습니다 :
<!DOCTYPE html>
<html>
<head ng-app="MyFirstApp">
<title>My Page</title>
<script src="bower_components/angular/angular.js"></script>
<script>
var mod = angular.module("MyFirstApp", []);
mod.controller('myController', function($scope){
alert("Hi");
$scope.a = 5;
});
</script>
</head>
<body ng-controller="myController">
<h1> My Body </h1>
<div>
<h1>{{a}}</h1>
</div>
</body>
</html>
모든 것이 잘로드되고 콘솔에 오류가 없습니다. 나는 이중 및 삼중 검사를하고 모든 변수의 철자가 정확합니다.
왜 작동하지 않는지 말할 수 있습니까?
<html ng-app="MyFirstApp">
또는
<body ng-app="MyFirstApp">
통해 UR <head ng-app="MyFirstApp">
이 같은 NG-응용 프로그램을 정의 할 경우
처럼
aw dammit. 맞아. 나는 그것을 잡지 못해서 너무 유감입니다. 정말 고맙습니다! – CodyBugstein
환영합니다, chreez :) –