Contenu connexe Similaire à An Intro to AngularJS (20) Plus de Kentucky JavaScript Users Group (9) An Intro to AngularJS6. Other topics
Routing
Tames management of single page apps
Often involving Partial Views
Testing
Testacular
7. Resources
Seed project with base layout
https://github.com/angular/angular-seed
Tutorials, Videos and Docs
http://angularjs.org/ - Learn
http://egghead.io
8. Example App HTML
<html>
<head>
<title>Demo</title>
</head>
<body ng-app ng-controller="AttendeeCtrl">
<h2>Attendees</h2>
<div>
<span>{{attendees.length}} in Attendance</span>
<ul>
<li ng-repeat="attendee in attendees">
{{attendee.name}}
</li>
</ul>
<form ng-submit="addAttendee()">
<input type="text" size="30" ng-model="attendeeName"
placeholder="add new name here">
<input type="submit" value="add">
</form>
</div>
<script src="lib/angular/angular.js"></script>
<script src="js/controllers.js"></script>
</body>
</html>
9. Example App Controller JS
'use strict';
/* Controllers */
function AttendeeCtrl($scope) {
// Some sample data
$scope.attendees = [
{name:'Ronald'},
{name:'Aaron'}];
$scope.addAttendee = function() {
$scope.attendees.push({name:$scope.attendeeName});
$scope.attendeeName = '';
};
}