Leanpub Header

Skip to main content

Angular 2 na prática (PT-BR)

Com Node/npm, Typescript, SystemJS e Visual Studio Code

Construa aplicações web com novo framework Angular 2, que foi totalmente remodelado contendo novos conceitos e implementações.

Versão atual do livro: Angular 2.0.0-rc.5 (2016-08-09)

Free With Membership

With Membership

Free!

$7.99

You pay

$0.00

Authors earn

$0.00
$

...Or Buy With Credits!

You can get credits monthly with a Reader Membership
PDF
EPUB
WEB
803
Readers
219
Pages
25,760Words
About

About

About the Book

Esta obra exibe todos os passos necessários para a construção de aplicações SPA(Single Page Application ) com o novíssimo Angular 2 (em beta até este momento). Através desta obra você aprenderá:

  • Guia completo sobre TypeScript
  • Uso da novíssima IDE Visual Studio Code 
  • Como criar um projeto base em Angular 2
  • Compreender como funciona o import com SystemJS
  • Componentes
  • Eventos
  • Módulos
  • Services
  • Template System
  • Uso do http para conexao com o servidor
  • Bônus:
    • Como instalar e operar o Node/NPM
    • Como operar o MongoDB pelo mongolab
    • Como criar um servidor completo RESTful com Express
  • Exemplo final completo no github
  • Exemplo final com login utilizando Json Web Token
  • Deploy de toda aplicação na Digital Ocean com nginx+node

Esta obra ainda não aborda a migrção do Angular 1 para o Angular 2. Será criado um capítulo específico quando houver o lançamento oficial do Angular 2

Share this book

Categories

Author

About the Authors

Daniel Schmitz

Daniel Schmitz is a software developer and writer. He's originally from Brazil and has published several books in Portuguese/English.

Daniel Pedrinha Georgii

Translations

Translations

Languages

Contents

Table of Contents

1.Introdução

  1. 1.1Pré requisitos
  2. 1.1.1Node
  3. 1.1.2Servidor web
  4. Dicas para Windows
  5. Dicas para Linux
  6. 1.1.3Arquivo package.json
  7. 1.1.4Arquivo package.json
  8. 1.1.5Editores de texto e IDEs
  9. 1.2Além do Javascript
  10. 1.3TypeScript
  11. 1.4Código fonte

2.TypeScript

  1. 2.1Instalando TypeScript
  2. 2.2Uso do Visual Studio Code
  3. 2.2.1Detectando alterações
  4. 2.2.2Debug no Visual Studio Code
  5. 2.2.3Debug no navegador
  6. 2.3Tipos
  7. 2.3.1Tipos Básicos
  8. 2.3.2Arrays
  9. 2.3.3Enum
  10. 2.3.4Any
  11. 2.3.5Void
  12. 2.4Classes
  13. 2.4.1Construtor
  14. 2.4.2Visibilidade de métodos e propriedades
  15. 2.5Herança
  16. 2.6Accessors (get/set)
  17. 2.7Métodos Estáticos
  18. 2.8Interfaces
  19. 2.9Funções
  20. 2.9.1Valor padrão
  21. 2.9.2Valor opcional
  22. 2.10Parâmetros Rest
  23. 2.11Parâmetros no formato JSON
  24. 2.12Módulos
  25. 2.12.1Exemplo com Systemjs
  26. 2.12.2Omitindo arquivos js e map no VSCode
  27. 2.12.3Uso do SystemJS
  28. 2.13Decorators (ou annotation)
  29. 2.14Conclusão

3.Um pouco de prática

  1. 3.1Projeto AngularBase
  2. 3.1.1Configurando o projeto
  3. 3.1.2Configurando a compilação do TypeScript
  4. 3.1.3Criando o primeiro componente Angular 2
  5. 3.1.4Criando o módulo
  6. 3.1.5Criando o bootstrap
  7. 3.1.6Criando o arquivo html
  8. 3.2Criando uma pequena playlist
  9. 3.2.1Estrutura inicial dos arquivos
  10. 3.2.2Criando um arquivo de configuração da aplicação
  11. 3.2.3Adicionando bootstrap
  12. 3.2.4Criando a classe Video
  13. 3.2.5Criando uma lista simples de vídeos
  14. 3.2.6Criando sub-componentes
  15. 3.2.7Formatando o template
  16. 3.2.8Repassando valores entre componentes
  17. 3.2.9Selecionando um vídeo
  18. 3.2.10Eventos
  19. 3.2.11Propagando eventos
  20. 3.2.12Exibindo os detalhes do vídeo
  21. 3.2.13Editando os dados do video selecionado
  22. 3.2.14Editando o título
  23. 3.2.15Criando um novo item
  24. 3.2.16Algumas considerações
  25. 3.3Criando Componentes
  26. 3.4Componentes Hierárquicos

4.Um pouco de teoria

  1. 4.1Visão Geral
  2. 4.2Módulo (module)
  3. 4.2.1Library Module
  4. 4.3@ngModule
  5. 4.4Componente (component)
  6. 4.5Template
  7. 4.5.1Interpolation (Uso de {{ }})
  8. 4.5.2Template Expressions
  9. 4.6Property Bind
  10. 4.6.1Laços
  11. 4.6.2Pipes (Operador |)
  12. 4.7Metadata (annotation)
  13. 4.8Serviço (Service)
  14. 4.9Injeção de dependência
  15. 4.9.1Uso do @Injectable()

5.Formulários

  1. 5.1Criando o projeto inicial
  2. 5.2Uso do ngControl
  3. 5.3Exibindo uma mensagem de erro
  4. 5.4Desabilitando o botão de submit do formulário
  5. 5.5Submit do formulário
  6. 5.6Controlando a visibilidade do formulário

6.Conexão com o servidor

  1. 6.1Criando o projeto
  2. 6.2Configurando o módulo
  3. 6.3Uso da classe Http
  4. 6.4Utilizando services
  5. 6.5Organização do projeto
  6. 6.6Model user
  7. 6.7Service user
  8. 6.8Alterando o componente AppComponent
  9. 6.9Enviando dados

7.Routes

  1. 7.1Aplicação AngularRoutes
  2. 7.2Dividindo a aplicação em partes
  3. 7.3Criando a área onde os componentes serão carregados
  4. 7.4Configurando o router
  5. 7.5Criando links para as rotas
  6. 7.6Repassando parâmetros

8.Exemplo Final - Servidor

  1. 8.1Criando o servidor RESTful
  2. 8.2O banco de dados MongoDB
  3. 8.3Criando o projeto
  4. 8.4Estrutura do projeto
  5. 8.5Configurando os modelos do MondoDB
  6. 8.6Configurando o servidor Express
  7. 8.7Testando o servidor
  8. 8.8Testando a api sem o Angular

9.Exemplo Final - Cliente

  1. 9.1Arquivos iniciais
  2. 9.2Preparando o Template base da aplicação
  3. 9.3Implementando o roteamento (Router)
  4. 9.3.1Criando componentes
  5. 9.3.2Configurando o @RouteConfig
  6. 9.3.3Configurando o menu
  7. 9.3.4Configurando o router-outlet
  8. 9.4Exibindo Posts
  9. 9.5Login
  10. 9.6Services
  11. 9.6.1LoginService
  12. 9.6.2UserService
  13. 9.6.3HeadersService
  14. 9.7Conectando no servidor
  15. 9.8Posts
  16. 9.8.1PostService
  17. 9.9Refatorando a tela inicial
  18. 9.10Conclusão

10.Utilizando Sublime Text

  1. 10.1Instalação
  2. 10.2Adicionando suporte a linguagem TypeScript
  3. 10.3Automatizando a build TypeScript

11.Publicando a aplicação em um servidor cloud

  1. 11.1Criando a conta na Digital Ocean
  2. 11.2Criando o droplet (servidor)
  3. 11.3Configurando o acesso SSH
  4. 11.4Criando o usuário
  5. 11.5Instalando o git
  6. 11.6Instalando Node
  7. 11.7Instalando o nginx
  8. 11.8Instalando os módulos do node
  9. 11.9Recompilando os arquivos TypeScript
  10. 11.10Teste inicial
  11. 11.11Integração entre nginx e node
  12. 11.12Algumas considerações sobre node+nginx
  13. 11.13Domínio
  14. 11.14Conclusão

The Leanpub 60 Day 100% Happiness Guarantee

Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.

Now, this is technically risky for us, since you'll have the book or course files either way. But we're so confident in our products and services, and in our authors and readers, that we're happy to offer a full money back guarantee for everything we sell.

You can only find out how good something is by trying it, and because of our 100% money back guarantee there's literally no risk to do so!

So, there's no reason not to click the Add to Cart button, is there?

See full terms...

Earn $8 on a $10 Purchase, and $16 on a $20 Purchase

We pay 80% royalties on purchases of $7.99 or more, and 80% royalties minus a 50 cent flat fee on purchases between $0.99 and $7.98. You earn $8 on a $10 sale, and $16 on a $20 sale. So, if we sell 5000 non-refunded copies of your book for $20, you'll earn $80,000.

(Yes, some authors have already earned much more than that on Leanpub.)

In fact, authors have earned over $14 million writing, publishing and selling on Leanpub.

Learn more about writing on Leanpub

Free Updates. DRM Free.

If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).

Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.

Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.

Learn more about Leanpub's ebook formats and where to read them

Write and Publish on Leanpub

You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses!

Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks.

Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. (Or, if you are producing your ebook your own way, you can even upload your own PDF and/or EPUB files and then publish with one click!) It really is that easy.

Learn more about writing on Leanpub