I am trying to refresh my knowledge of Angular, and I can't seem to understand a few concepts, the "controller as" pattern doesn't seem to be working, for example, even though it seems to be much more simple than $scope.
I can't get a simple variable to show up in my HTML.
Here are two pieces of code in question:
app.js
angular
.module('routerApp', [''])
.controller('mainController', function () {
'use strict';
var vm = this;
vm.bigMessage = 'A smooth sea never made a skilled sailor';
})
index.html (stripped down heavily)
<!DOCTYPE html>
<html>
<head>
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.3.16/angular.min.js"></script>
<script src="js/app.js"></script>
</head>
<body class="container" ng-app="routerApp" ng-controller="mainController as main">
<h1>{{ main.bigMesssage }}</h1>
</body>
</html>
The interesting thing is that the browser doesn't even render "{{ main.bigMessage }}", instead it shows nothing. Yet, in the source code there is the {{ ... }} part.