AngularJS code not working on chrome on localhost in a folder
I am running simple hello world program (using AngularJS 1.6) from localhost on my ubuntu 17.04, localhost address is http://localhost/js/angular/4/
and the program is not working in Google Chrome, the same code runs all fine on Firefox, and if I rename the same folder to another number or if I keep the same code in another folder, it seems to be working all fine. What could be the reason of this weird behavior as I couldn't find anything similar to this on Internet while searching for the solution.
var app = angular.module("myApp", []);
app.controller("myCtrl", function($scope) {
$scope.message = "Hello World";
});
<!DOCTYPE html>
<html>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular.min.js"></script>
<body ng-app="myApp">
<div ng-controller="myCtrl">
{{ message}}
</div>
</body>
</html>
ng-app
和ng-controller
不能在同一个元素上。
上一篇: 用HTML / CSS填充和输入高亮