Você está na página 1de 30

Ao final da sessão, você vai:

Saber o que é Conhecer sua Estar apto para


Node.js e estrutura básica e implantaraplicativos
AngularJS. navegação. web usando o
Entender para quê Node.js e Angular
eles são usados. no Azure.
Loop de
eventos
Módulos de terceiros

Módulos do Node

Plataforma Node.js
{
"name": “ejemplonodejs",
"version": "0.0.0",
"private": true,
"scripts": {
"start": "node ./bin/www"
},
"dependencies": {
"body-parser": "~1.15.2",
"cookie-parser": "~1.4.3",
"debug": “~2.2.0",
"ejs": “~2.5.2",
"express": “~4.14.0",
"mongoose": "^4.7.2",
"morgan": “~1.7.0",
"serve-favicon": "~2.3.0"
}
}
https://siftery.com/nodejs
<!DOCTYPE html> function myController() {
<html> alert(“Olá Mundo”);
<body ng-controller=“myController”> }

Nome da
</body> função a ser chamada
</html>

Diretiva
<!DOCTYPE html>
<html>
<html ng-app=“movieapp” >
<body>
<script type=“text/javascript” src=“angular.min.js”></script>
<script type=“text/javascript” src=“app.js”></script>
</body>
</html>

var movieapp = angular.module(“movieapp”, [ ] ); app.js


<p> <p>
Tenho {{ 8 * 4 }} anos Tenho 32 anos
</p> </p>

<p> <p>
{{ “Olá” + “ Carlos” }} Olá, Carlos.
</p> </p>

https://docs.angularjs.org/guide/expression
(function(){ <body>
var movieapp = angular.module(“movieapp”,<div[ ] );ng-controller=“MovieController as mc”>
<h1>{{ mc.movie.name }}</h1>
movieapp.controller(‘MovieController’, function(){
<h2>{{ mc.movie.description }}</h2>
this.movie = movie; <p>En cines: <input type=“checkbox” ng-
}); checked=“mc.movie.inTheaters”/> </p>
var movie = { </div>
name: ‘Inside Out’, </body>
description: ‘…’,
inTheaters: true
}
})();
<nombre-pelicula></nombre-pelicula> index.html
camelCase
movieapp.directive(‘nombrePelicula’, function(){
return {
restrict: ‘E’,
templateUrl: ‘nombre-pelicula.html’
};
}); app.js

<h3>{{ movie.name }}</h3> nombre-pelicula.html


$http({ method: ‘GET’, url: ‘/movies.json’ });

$http.get(‘/movies.json’, { apiKey: ‘miApiKey’ });


(function(){
var movieapp = angular.module(“movieapp”, [ ] );

movieapp.controller(‘MovieController’, [ ‘$http’, function( $http ){


var theater = this;
//inicializar porque o aplicativo será renderizado antes que a solicitação retorne os dados
theater.movies = [ ];

$http.get( ‘/movies.json’ ).success( function( data ) {


theater.movies = data;
});
});
})();
+
+
Node.js
nodejs.org
meanjs.org

AngularJS
angularjs.org
AngularJS API Docs

Microsoft Azure
Começando a usar aplicativos web Node.js no Azure App Service

Você também pode gostar