... by creating our first module
Note: These notes work!!!
Containers for different parts of your application.
Except those containers can use other containers.
Places where we will write pieces of our application and define dependencies Note: Mention modular design and a graphic would be helpful here
- Maintainable and testable
- Readable
Create a new file, app.js, and add:
var app = angular.module('collection', [ ]);
And in our HTML file
<!DOCTYPE HTML>
<html ng-app="collection">
<head>
<link rel="stylesheet" type="text/css" href="boostrap.min.css"></link>
</head>
<body>
<!--
<script type="text/javascript" src="angular.min.js"></script>
<script type="text/javascript" src="app.js"></script>
-->
</body>
</html>
You've made a module!
Note:
- Create your app.js file, add main app module code
- angular is a call to angular.js
- 'collection' will be the name of your application, make sure to add it!
- will be where dependencies go
- Side note about ng-app
- It's telling angular that everything inside of html belongs to the app 'collection'
- It could even be empty