I'm completely new to AngularJS and I've encountered an issue.
Yesterday, I ran a very simple AngularJS application that I downloaded from a tutorial and it worked perfectly.
The application consists of 2 files:
1) index.htm:
<!DOCTYPE html>
<html lang="en-us" ng-app="angularApp">
<head>
<title>Introduction to AngularJS</title>
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
<meta charset="UTF-8">
<!-- load bootstrap and fontawesome via CDN -->
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" />
<style>
html, body
{
font-size: 1.1em;
}
</style>
<!-- load angular via CDN -->
<script src="//code.angularjs.org/1.3.0-rc.1/angular.min.js"></script>
<script src="app.js"></script>
</head>
<body>
<header>
<nav class="navbar navbar-default">
<div class="container">
<div class="navbar-header">
<a class="navbar-brand" href="/">AngularJS</a>
</div>
<ul class="nav navbar-nav navbar-right">
<li><a href="#"><i class="fa fa-home"></i> Home</a></li>
</ul>
</div>
</nav>
</header>
<div class="container">
<div ng-controller="mainController">
<h1>Hello world!</h1>
</div>
</div>
</body>
</html>
2) And the included app.js file:
// MODULE
var angularApp = angular.module('angularApp', []);
// CONTROLLERS
angularApp.controller('mainController', ['$scope', function ($scope) {
}]);
As you can see in the index.htm file include the local app.js file, AngularJS framework by:
<script src="//code.angularjs.org/1.3.0-rc.1/angular.min.js"></script>
and BootStrap CSS framework by:
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" />
Yesterday it worked fine but today when I try to open the index.htm file into my browser I obtain that BootStrap is not used (there are not CSS settings) and into the FireBug console I obtain this error message:
ReferenceError: angular is not defined
var angularApp = angular.module('angularApp', []);
It seems that can't see Angular framework and BootStrap also if there are correctly included and I can open in the browser the following links:
//code.angularjs.org/1.3.0-rc.1/angular.min.js
//netdna.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css
So why? What could be the problem? Yesteday it works fine