Just started learning AngularJS.
Currently following this MEAN Stack Intro: Build an end-to-end application
Created a basic html file to test angularjs.
index.html
<html>
<head>
<meta charset="utf-8">
<title>Stack POC</title>
<script type="application/javascript" src="app/scripts/controllers/user_controller.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">
</head>
<body ng-app="userListApp">
<div ng-controller="userListController">
<h1>Total users: {{userCounts}}</h1>
</div>
</body>
</html>
app/scripts/controllers/user_controller.js
angular.module('userListApp', []).controller('userListController', function($scope){
$scope.userCounts = 10;
});
However, upon running the code, I don't see:
Total users: {{ userCounts }}
Instead of displaying the count as 10
.
Using gulp and gulp-connect for development server setup.
gulpfile.js
var gulp = require('gulp'),
connect = require('gulp-connect');
gulp.task('serve', function() {
connect.server({
root: '.',
port: 8888
});
});
gulp.task('default', ['serve']);
package.json
{
"name": "poc",
"version": "1.0.0",
"description": "",
"main": "gulpfile.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"devDependencies": {
"gulp": "^3.9.1",
"gulp-connect": "^3.2.2"
}
}
Viewing the page on firefox 45.0.2 browser.