Rodrigo Branas – @rodrigobranas - http://www.agilecode.com.br
Introdução ao AngularJS
AngularJS é um framework para o
desenvolvimento de aplicações web
utilizando a linguagem JavaScript!
Estrutura a arquitetura da aplicação em
camadas bem definidas
Permite a criação componentes
reusáveis e modulares
Fornece a infraestrutura necessária
para integrar com o back-end
Facilita a automação de testes
Miško Hevery e Adams Abrons
criaram o projeto em 2009
Facilitar a criação de aplicações web!
Já pensou quanto código precisamos
escrever para criar uma aplicação simples?
17.000 linhas e 6 meses depois...
Aposto que consigo reescrever o
projeto todo em apenas 2 semanas...
Eles conseguiram reescrever tudo em
apenas 1.500 linhas, 3 semanas depois
Atualmente, o projeto AngularJS é
mantido pelo Google!
O interesse pelo framework vem
crescendo cada vez mais!
1.0.0 temporal-domination (2012-06-13)
1.2.0 timely-delivery (2013-11-08)
1.3.0 superluminal-nudge (2014-10-13)
1.4.0-beta.6 cookie-liberation (2015-03-17)
Quem está usando AngularJS?
Por que eu deveria utilizar
AngularJS ?
Produtividade
Continuidade
Comunidade
Totalmente escrito em JavaScript
Isso quer dizer que toda a aplicação
roda browser do cliente?
Vai funcionar em todos os browsers?
Como fica a performance?
E a segurança do código?
Arquitetura do framework
O que é arquitetura?
Qual é a diferença entre arquitetura e design?
Surgimento do padrão MVC
Model-View-Controller
Trygve Reenskaug
Criou o padrão em 1978 na Xerox (PARC)
MVC, MVP, MVVM e MVW
Separação de responsabilidades
View
É o que o cliente vê
Controller
Responsável pelo que a View consome
Scope
Faz a mediação entre a View e o Controller
Hello World!
http://www.angularjs.org
1. <html>
2. <head>
3. <title>Hello World</title>
4. </head>
5. <body>
6. </body>
7. </html>
1. <html>
2. <head>
3. <title>Hello World</title>
4. <script src='angular.js'></script>
5. </head>
6. <body>
7. </body>
8. </html>
1. <html ng-app="helloWorld">
2. <head>
3. <title>Hello World</title>
4. <script src='angular.js'></script>
5. </head>
6. <body>
7. </body>
8. </html>
1. <html ng-app="helloWorld">
2. <head>
3. <title>Hello World</title>
4. <script src='angular.js'></script>
5. <script>
6. </script>
7. </head>
8. <body>
9. </body>
10. </html>
1. <html ng-app="helloWorld">
2. <head>
3. <title>Hello World</title>
4. <script src='angular.js'></script>
5. <script>
6. </script>
7. </head>
8. <body>
9. </body>
10. </html>
1. <html ng-app="helloWorld">
2. <head>
3. <title>Hello World</title>
4. <script src='angular.js'></script>
5. <script>
6. angular.module("helloWorld", []);
7. </script>
8. </head>
9. <body>
10. </body>
11. </html>
1. <html ng-app="helloWorld">
2. <head>
3. <title>Hello World</title>
4. <script src='angular.js'></script>
5. <script>
6. angular.module("helloWorld", []);
7. </script>
8. </head>
9. <body>
10. </body>
11. </html>
1. <html ng-app="helloWorld">
2. <head>
3. <title>Hello World</title>
4. <script src='angular.js'></script>
5. <script>
6. var app = angular.module("helloWorld", []);
7. </script>
8. </head>
9. <body>
10. </body>
11. </html>
1. <html ng-app="helloWorld">
2. <head>
3. <title>Hello World</title>
4. <script src='angular.js'></script>
5. <script>
6. var app = angular.module("helloWorld", []);
7. </script>
8. </head>
9. <body>
10. </body>
11. </html>
1. <html ng-app="helloWorld">
2. <head>
3. <title>Hello World</title>
4. <script src='angular.js'></script>
5. <script>
6. var app = angular.module("helloWorld", []);
7. </script>
8. </head>
9. <body>
10. </body>
11. </html>
1. <html ng-app="helloWorld">
2. <head>
3. <title>Hello World</title>
4. <script src='angular.js'></script>
5. <script>
6. var app = angular.module("helloWorld", []);
7. </script>
8. </head>
9. <body>
10. </body>
11. </html>
1. <html ng-app="helloWorld">
2. <head>
3. <title>Hello World</title>
4. <script src='angular.js'></script>
5. <script>
6. var app = angular.module("helloWorld", []);
7. </script>
8. </head>
9. <body>
10. </body>
11. </html>
1. <html ng-app="helloWorld">
2. <head>
3. <title>Hello World</title>
4. <script src='angular.js'></script>
5. <script>
6. var app = angular.module("helloWorld", []);
7. app.controller("helloWorldCtrl", function($scope) {
8. });
9. </script>
10. </head>
11. <body>
12. </body>
13. </html>
1. <html ng-app="helloWorld">
2. <head>
3. <title>Hello World</title>
4. <script src='angular.js'></script>
5. <script>
6. var app = angular.module("helloWorld", []);
7. app.controller("helloWorldCtrl", function($scope) {
8. });
9. </script>
10. </head>
11. <body>
12. </body>
13. </html>
1. <html ng-app="helloWorld">
2. <head>
3. <title>Hello World</title>
4. <script src='angular.js'></script>
5. <script>
6. var app = angular.module("helloWorld", []);
7. app.controller("helloWorldCtrl", function($scope) {
8. $scope.message = "Hello World!";
9. });
10. </script>
11. </head>
12. <body>
13. </body>
14. </html>
1. <html ng-app="helloWorld">
2. <head>
3. <title>Hello World</title>
4. <script src='angular.js'></script>
5. <script>
6. var app = angular.module("helloWorld", []);
7. app.controller("helloWorldCtrl", function($scope) {
8. $scope.message = "Hello World!";
9. });
10. </script>
11. </head>
12. <body>
13. </body>
14. </html>
1. <html ng-app="helloWorld">
2. <head>
3. <title>Hello World</title>
4. <script src='angular.js'></script>
5. <script>
6. var app = angular.module("helloWorld", []);
7. app.controller("helloWorldCtrl", function($scope) {
8. $scope.message = "Hello World!";
9. });
10. </script>
11. </head>
12. <body ng-controller="helloWorldCtrl">
13. </body>
14. </html>
1. <html ng-app="helloWorld">
2. <head>
3. <title>Hello World</title>
4. <script src='angular.js'></script>
5. <script>
6. var app = angular.module("helloWorld", []);
7. app.controller("helloWorldCtrl", function($scope) {
8. $scope.message = "Hello World!";
9. });
10. </script>
11. </head>
12. <body ng-controller="helloWorldCtrl">
13. </body>
14. </html>
1. <html ng-app="helloWorld">
2. <head>
3. <title>Hello World</title>
4. <script src='angular.js'></script>
5. <script>
6. var app = angular.module("helloWorld", []);
7. app.controller("helloWorldCtrl", function($scope) {
8. $scope.message = "Hello World!";
9. });
10. </script>
11. </head>
12. <body ng-controller="helloWorldCtrl">
13. {{message}}
14. </body>
15. </html>
1. <html ng-app="helloWorld">
2. <head>
3. <title>Hello World</title>
4. <script src='angular.js'></script>
5. <script>
6. var app = angular.module("helloWorld", []);
7. app.controller("helloWorldCtrl", function($scope) {
8. $scope.message = "Hello World!";
9. });
10. </script>
11. </head>
12. <body ng-controller="helloWorldCtrl">
13. {{message}}
14. </body>
15. </html>
Introdução ao AngularJS

Introdução ao AngularJS

Notas do Editor