##Step 1: Angular Set-up Make sure the angular app is plugged in by defining a name for the app in the javascript file, and linking it in the html tag in our html file:
- app.js
angular
.module('appName', []);
- index.html
<html lang="en" ng-app="appName">
##Step 2: Create our controllers If we're using a controller, we need to define it in javascript along with our app:
- app.js
angular
.module('appName', [])
.controller('PageController', PageController);
function PageController () {
var vm = this;
vm.newPerson = {};
vm.newPerson = {
name: 'Alicia',
occupation: 'WDI student'
};
}
##Step 3: Use the controller wherever needed Declare the controller's use in the proper place in our html file:
- index.html
<div class="container" ng-controller="PageController as pageCtrl">
<!--html inside of here can display and adjust the information from the PageController-->
</div>