Presented by Scott Covert / @scottbcovert
This ain't your mama's app architecture
HTML enhanced for web apps!
Concept | Description |
---|---|
Template | HTML with additional markup |
Directives | extend HTML via custom attributes and elements |
Scope | context where the model is stored |
Service | reusable business logic independent of views |
Controller | the business logic behind views |
Module | a container for the different parts of an AngularJS app |
<!doctype html>
<html lang="en" ng-app="phonecatApp">
<head>
Google Phone Gallery
</head>
<body ng-controller="PhoneListCtrl">
Search:
Sort by:
-
{{phone.name}}
{{phone.snippet}}
</body>
</html>
'use strict';
/* Controllers */
var phonecatApp = angular.module('phonecatApp', []);
phonecatApp.controller('PhoneListCtrl', function($scope) {
$scope.phones = [
{'name': 'Nexus S',
'snippet': 'Fast just got faster with Nexus S.',
'age': 1},
{'name': 'Motorola XOOMâ„¢ with Wi-Fi',
'snippet': 'The Next, Next Generation tablet.',
'age': 2},
{'name': 'MOTOROLA XOOMâ„¢',
'snippet': 'The Next, Next Generation tablet.',
'age': 3}
];
$scope.orderProp = 'age';
});