Angular 2 na prática (PT-BR)
Angular 2 na prática (PT-BR)
Com Node/npm, Typescript, SystemJS e Visual Studio Code
Sobre o Livro
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
Table of Contents
-
1. Introdução
-
1.1 Pré requisitos
- 1.1.1 Node
- 1.1.2 Servidor web
- 1.1.3 Arquivo package.json
- 1.1.4 Arquivo package.json
- 1.1.5 Editores de texto e IDEs
- 1.2 Além do Javascript
- 1.3 TypeScript
- 1.4 Código fonte
-
1.1 Pré requisitos
-
2. TypeScript
- 2.1 Instalando TypeScript
-
2.2 Uso do Visual Studio Code
- 2.2.1 Detectando alterações
- 2.2.2 Debug no Visual Studio Code
- 2.2.3 Debug no navegador
-
2.3 Tipos
- 2.3.1 Tipos Básicos
- 2.3.2 Arrays
- 2.3.3 Enum
- 2.3.4 Any
- 2.3.5 Void
-
2.4 Classes
- 2.4.1 Construtor
- 2.4.2 Visibilidade de métodos e propriedades
- 2.5 Herança
- 2.6 Accessors (get/set)
- 2.7 Métodos Estáticos
- 2.8 Interfaces
-
2.9 Funções
- 2.9.1 Valor padrão
- 2.9.2 Valor opcional
- 2.10 Parâmetros Rest
- 2.11 Parâmetros no formato JSON
-
2.12 Módulos
- 2.12.1 Exemplo com Systemjs
- 2.12.2 Omitindo arquivos js e map no VSCode
- 2.12.3 Uso do SystemJS
- 2.13 Decorators (ou annotation)
- 2.14 Conclusão
-
3. Um pouco de prática
-
3.1 Projeto AngularBase
- 3.1.1 Configurando o projeto
- 3.1.2 Configurando a compilação do TypeScript
- 3.1.3 Criando o primeiro componente Angular 2
- 3.1.4 Criando o módulo
- 3.1.5 Criando o bootstrap
- 3.1.6 Criando o arquivo html
-
3.2 Criando uma pequena playlist
- 3.2.1 Estrutura inicial dos arquivos
- 3.2.2 Criando um arquivo de configuração da aplicação
- 3.2.3 Adicionando bootstrap
- 3.2.4 Criando a classe Video
- 3.2.5 Criando uma lista simples de vídeos
- 3.2.6 Criando sub-componentes
- 3.2.7 Formatando o template
- 3.2.8 Repassando valores entre componentes
- 3.2.9 Selecionando um vídeo
- 3.2.10 Eventos
- 3.2.11 Propagando eventos
- 3.2.12 Exibindo os detalhes do vídeo
- 3.2.13 Editando os dados do video selecionado
- 3.2.14 Editando o título
- 3.2.15 Criando um novo item
- 3.2.16 Algumas considerações
- 3.3 Criando Componentes
- 3.4 Componentes Hierárquicos
-
3.1 Projeto AngularBase
-
4. Um pouco de teoria
- 4.1 Visão Geral
-
4.2 Módulo (module)
- 4.2.1 Library Module
- 4.3 @ngModule
- 4.4 Componente (component)
-
4.5 Template
- 4.5.1 Interpolation (Uso de {{ }})
- 4.5.2 Template Expressions
-
4.6 Property Bind
- 4.6.1 Laços
- 4.6.2 Pipes (Operador |)
- 4.7 Metadata (annotation)
- 4.8 Serviço (Service)
-
4.9 Injeção de dependência
- 4.9.1 Uso do @Injectable()
-
5. Formulários
- 5.1 Criando o projeto inicial
- 5.2 Uso do ngControl
- 5.3 Exibindo uma mensagem de erro
- 5.4 Desabilitando o botão de submit do formulário
- 5.5 Submit do formulário
- 5.6 Controlando a visibilidade do formulário
-
6. Conexão com o servidor
- 6.1 Criando o projeto
- 6.2 Configurando o módulo
- 6.3 Uso da classe Http
- 6.4 Utilizando services
- 6.5 Organização do projeto
- 6.6 Model user
- 6.7 Service user
- 6.8 Alterando o componente AppComponent
- 6.9 Enviando dados
-
7. Routes
- 7.1 Aplicação AngularRoutes
- 7.2 Dividindo a aplicação em partes
- 7.3 Criando a área onde os componentes serão carregados
- 7.4 Configurando o router
- 7.5 Criando links para as rotas
- 7.6 Repassando parâmetros
-
8. Exemplo Final - Servidor
- 8.1 Criando o servidor RESTful
- 8.2 O banco de dados MongoDB
- 8.3 Criando o projeto
- 8.4 Estrutura do projeto
- 8.5 Configurando os modelos do MondoDB
- 8.6 Configurando o servidor Express
- 8.7 Testando o servidor
- 8.8 Testando a api sem o Angular
-
9. Exemplo Final - Cliente
- 9.1 Arquivos iniciais
- 9.2 Preparando o Template base da aplicação
-
9.3 Implementando o roteamento (Router)
- 9.3.1 Criando componentes
- 9.3.2 Configurando o @RouteConfig
- 9.3.3 Configurando o menu
- 9.3.4 Configurando o router-outlet
- 9.4 Exibindo Posts
- 9.5 Login
-
9.6 Services
- 9.6.1 LoginService
- 9.6.2 UserService
- 9.6.3 HeadersService
- 9.7 Conectando no servidor
-
9.8 Posts
- 9.8.1 PostService
- 9.9 Refatorando a tela inicial
- 9.10 Conclusão
-
10. Utilizando Sublime Text
- 10.1 Instalação
- 10.2 Adicionando suporte a linguagem TypeScript
- 10.3 Automatizando a build TypeScript
-
11. Publicando a aplicação em um servidor cloud
- 11.1 Criando a conta na Digital Ocean
- 11.2 Criando o droplet (servidor)
- 11.3 Configurando o acesso SSH
- 11.4 Criando o usuário
- 11.5 Instalando o git
- 11.6 Instalando Node
- 11.7 Instalando o nginx
- 11.8 Instalando os módulos do node
- 11.9 Recompilando os arquivos TypeScript
- 11.10 Teste inicial
- 11.11 Integração entre nginx e node
- 11.12 Algumas considerações sobre node+nginx
- 11.13 Domínio
- 11.14 Conclusão
Authors have earned$10,089,287writing, publishing and selling on Leanpub, earning 80% royalties while saving up to 25 million pounds of CO2 and up to 46,000 trees.
Aprenda sobre como escrever na Leanpub
A garantia Leanpub incondicional, sem riscos, de 100% de satisfação
Durante 45 dias da data de compra você pode solicitar o reembolso total de qualquer compra Leanpub, em dois cliques. Nós processamos os reembolsos manualmente, então eles podem demorar alguns dias para aparecer. Veja os termos completos.
Atualizações grauitas. Sem DRM.
Se você compra um livro da Leanpub, você recebe atualizações gratuitas enquanto o autor atualizar o livro! Muitos autores utilizam a Leanpub para publicar os seus livros em andamento, enquanto eles estão os escrevendo. Todos os leitores recebem atualizações gratuitas, não importa quando ou por quanto eles compraram o livro (até mesmo de graça).
A maioria dos livros Leanpub estão disponíveis em PDF (para computadores), EPUB (para telefones e tablets) e MOBI (para Kindle). Os formatos que um livro inclui são exibidos no top direito dessa página.
Por último, livros Leapub não têm nenhuma proteção anti-cópias DRM sem sentido, então você pode facilmente lê-los em qualquer dispositivo suportado.
Aprenda mais sobre os formatos de ebook da Leanpub e aonde lê-los
Top Books
C++20
Rainer GrimmC++20 is the next big C++ standard after C++11. As C++11 did it, C++20 changes the way we program modern C++. This change is, in particular, due to the big four of C++20: ranges, coroutines, concepts, and modules.
The book is almost daily updated. These incremental updates ease my interaction with the proofreaders.
A Guide to Artificial Intelligence in Healthcare
Dr. Bertalan MeskoCan we stay human in the age of A.I.? To go even further, can we grow in humanity, can we shape a more humane, more equitable and sustainable healthcare? This e-book aims to prepare healthcare and medical professionals for the era of human-machine collaboration. Read our guide to understanding, anticipating and controlling artificial intelligence.
C++ Best Practices
Jason TurnerLevel up your C++, get the tools working for you, eliminate common problems, and move on to more exciting things!
Atomic Kotlin
Bruce Eckel and Svetlana IsakovaFor both beginning and experienced programmers! From the author of the multi-award-winning Thinking in C++ and Thinking in Java together with a member of the Kotlin language team comes a book that breaks the concepts into small, easy-to-digest "atoms," along with exercises supported by hints and solutions directly inside IntelliJ IDEA!
Sockets and Pipes
Type ClassesSockets and Pipes is not an introduction to Haskell; it is an introduction to writing software in Haskell. Using a handful of everyday Haskell libraries, this book walks through reading the HTTP specification and implementing it to create a web server.
Introducing EventStorming
Alberto BrandoliniThe deepest tutorial and explanation about EventStorming, straight from the inventor.
node-opcua by example
Etienne RossignonGet the best out of node-opcua through a set of documented examples by the author himself that will allow you to create stunning OPCUA Servers or Clients.
Ansible for DevOps
Jeff GeerlingAnsible is a simple, but powerful, server and configuration management tool. Learn to use Ansible effectively, whether you manage one server—or thousands.
Functional Design and Architecture
Alexander GraninSoftware Design in Functional Programming, Design Patterns and Practices, Methodologies and Application Architectures. How to build real software in Haskell with less efforts and low risks. The first complete source of knowledge.
Composing Software
Eric ElliottAll software design is composition: the act of breaking complex problems down into smaller problems and composing those solutions. Most developers have a limited understanding of compositional techniques. It's time for that to change.
Top Bundles
- #1
Software Architecture for Developers: Volumes 1 & 2 - Technical leadership and communication
2 Books
"Software Architecture for Developers" is a practical and pragmatic guide to modern, lightweight software architecture, specifically aimed at developers. You'll learn:The essence of software architecture.Why the software architecture role should include coding, coaching and collaboration.The things that you really need to think about before... - #2
All the Books of The Medical Futurist
6 Books
We put together the most popular books from The Medical Futurist to provide a clear picture about the major trends shaping the future of medicine and healthcare. Digital health technologies, artificial intelligence, the future of 20 medical specialties, big pharma, data privacy, digital health investments and how technology giants such as Amazon... - #3
PowerShell
3 Books
Buy every PowerShell book from Adam Bertram at a 20% discount! - #4
Cisco CCNA 200-301 Complet
4 Books
Ce lot comprend les quatre volumes du guide préparation à l'examen de certification Cisco CCNA 200-301. - #5
Linux Administration Complet
4 Books
Ce lot comprend les quatre volumes du Guide Linux Administration :Linux Administration, Volume 1, Administration fondamentale : Guide pratique de préparation aux examens de certification LPIC 1, Linux Essentials, RHCSA et LFCS. Administration fondamentale. Introduction à Linux. Le Shell. Traitement du texte. Arborescence de fichiers. Sécurité... - #6
Modern C++ by Nicolai Josuttis
2 Books
- #7
Django for Beginners/APIs/Professionals
3 Books
- #8
Learn Git, Bash, and Terraform the Hard Way
3 Books
Learn Git, Bash and Terraform using the Hard Way method.These technologies are essential tools in the DevOps armoury. These books walk you through their features and subtleties in a simple, gradual way that reinforces learning rather than baffling you with theory. - #9
Software Architecture and Beautiful APIs
2 Books
There is no better way to learn how to design good APIs than to look at many existing examples, complementing the Software Architecture theory on API design. - #10
Digital Future of Healthcare and Pharma
3 Books
These three popular e-books from The Medical Futurist describes how digital health technologies will shape the future of health, healthcare, medicine and pharma with exciting infographics in a digestible format.