- app
- src
- js
- libs
- angular.min.js
- app.js -sass
- sass-structure
- libs
- js
- index.html
- src
- gulpfile.js
- package.json
- readme.md
- run
(sudo) npm install - run
gulp - Then the browser will start.
In this example I already did the setup. But the most important things to do is:
- Include the angular.js file & app.js file in the html (on the bottom of the page)
<script src="assets/js/libs/angular.min.js"></script><script src="assets/js/app.js"></script>. But i prefer to concat all the .js files into 1 file. So that's why the index.html file only include app.js. - In the html replace the
<html>with<html ng-app>to let Angular know that this is the Angular Root element. - Then in your html place the following expression:
1 + 2 = {{ 1 + 2 }}. When AngularJS is loaded, it will do the math for you. demo - In the app.js place this code to begin the application:
var app = angular.module("app", []);