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$9,893,579writing, publishing and selling on Leanpub, earning 80% royalties while saving up to 25 million pounds of CO2 and up to 46,000 trees.
Learn more about writing on 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.
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), EPUB (for phones and tablets) and MOBI (for 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
Top Books
C++ Best Practices
Jason TurnerLevel up your C++, get the tools working for you, eliminate common problems, and move on to more exciting things!
OpenIntro Statistics
David Diez, Christopher Barr, Mine Cetinkaya-Rundel, and OpenIntroA complete foundation for Statistics, also serving as a foundation for Data Science.
Leanpub revenue supports OpenIntro (US-based nonprofit) so we can provide free desk copies to teachers interested in using OpenIntro Statistics in the classroom and expand the project to support free textbooks in other subjects.
More resources: openintro.org.
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.
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!
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.
Introductory Statistics with Randomization and Simulation
Mine Cetinkaya-Rundel, Christopher Barr, OpenIntro, and David DiezA complete foundation for Statistics, also serving as a foundation for Data Science, that introduces inference using randomization and simulation while covering traditional methods.
Leanpub revenue supports OpenIntro, so we can provide free desk copies to teachers interested in using our books in the classroom.
More resources: openintro.org.
Java OOP Done Right
Alan MellorObject Oriented Programming is still a great way to create clean, maintainable code. But only if you use it right.
This book gives you 25 years of OO best practice, ready to use.
You'll learn to design objects behaviour-first, use TDD to help, then confidently apply Design Patterns, SOLID principles and Refactoring to make clean, crafted code.
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.
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.
Cloud Strategy
Gregor Hohpe“Strategy is the difference between making a wish and making it come true.” A successful migration to the cloud shouldn’t be driven by wishes, but guided by a sound strategy, frameworks, and decision models. This book tells you how—without becoming superficial nor getting lost in technology and product details.
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
CCIE Service Provider Ultimate Study Bundle
2 Books
Piotr Jablonski, Lukasz Bromirski, and Nick Russo have joined forces to deliver the only CCIE Service Provider training resource you'll ever need. This bundle contains a detailed and challenging collection of workbook labs, plus an extensively detailed technical reference guide. All of us have earned the CCIE Service Provider certification... - #3
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. - #4
CCDE Practical Studies (All labs)
3 Books
CCDE lab - #5
Modern Management Made Easy
3 Books
Read all three Modern Management Made Easy books. Learn to manage yourself, lead and serve others, and lead the organization. - #6
The Future of Digital Health
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 and how technology giants such as Amazon or Google want to conquer... - #7
Modern C++ by Nicolai Josuttis
2 Books
- #8
Django for Beginners/APIs/Professionals
3 Books
- #9
"The C++ Standard Library" and "Concurrency with Modern C++"
2 Books
Get my books "The C++ Standard Library" and "Concurrency with Modern C++" in a bundle. The first book gives you the details you should know about the C++ standard library; the second one dives deeper into concurrency with modern C++. In sum, you get more than 600 pages full of modern C++ and about 250 source files presenting the standard library... - #10
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é...