Introduction to TypeScript & Angular

Slides:



Advertisements
Similar presentations
Project Tracking Tools Trello, Asana, Basecamp, GitHub Issue Tracker, TRAC SoftUni Team Technical Trainers Software University
Advertisements

AMD and RequireJS Splitting JavaScript Code into Dependent Modules Software University Technical Trainers SoftUni Team.
Asynchronous Web Services Writing Asynchronous Web Services SoftUni Team Technical Trainers Software University
JavaScript Tools Tools for Writing / Editing / Debugging JavaScript Code Svetlin Nakov Technical Trainer Software University
Doctrine The PHP ORM SoftUni Team Technical Trainers Software University
Inheritance Class Hierarchies SoftUni Team Technical Trainers Software University
Generics SoftUni Team Technical Trainers Software University
Version Control Systems
Auto Mapping Objects SoftUni Team Database Applications
Databases basics Course Introduction SoftUni Team Databases basics
C# Basic Syntax, Visual Studio, Console Input / Output
Interface Segregation / Dependency Inversion
Services & Dependency Injection
Data Structures Course Overview SoftUni Team Data Structures
C# MVC Frameworks – ASP.NET
C# Basic Syntax, Visual Studio, Console Input / Output
Web API - Introduction AJAX, Spring Data REST SoftUni Team Web API
Introduction to MVC SoftUni Team Introduction to MVC
Deploying Web Application
Setup a PHP + MySQL Development Environment
PHP MVC Frameworks Course Introduction SoftUni Team Technical Trainers
PHP Fundamentals Course Introduction SoftUni Team Technical Trainers
Reflection SoftUni Team Technical Trainers Java OOP Advanced
C# Database Fundamentals with Microsoft SQL Server
Introduction to Entity Framework
Application Architecture, Redux
ASP.NET Integration Testing
ASP.NET Unit Testing Unit Testing Web API SoftUni Team ASP.NET
Classes, Properties, Constructors, Objects, Namespaces
Mocking tools for easier unit testing
Parsing JSON JSON.NET, LINQ-to-JSON
State Management Cookies, Sessions SoftUni Team State Management
EF Code First (Advanced)
PHP MVC Frameworks MVC Fundamentals SoftUni Team Technical Trainers
C# Databases Advanced with Microsoft SQL Server
Software Technologies
Entity Framework: Code First
Unit Testing with Mocha
Databases advanced Course Introduction SoftUni Team Databases advanced
C#/Java Web Development Basics
Install and configure theme
Balancing Binary Search Trees, Rotations
Entity Framework: Relations
The Right Way Control Flow
Transactions in Entity Framework
ASP.NET MVC Introduction
C# Advanced Course Introduction SoftUni Team C# Technical Trainers
Databases Advanced Course Introduction SoftUni Team Databases Advanced
Best Practices and Architecture
C# Web Development Basics
Best practices and architecture
Data Definition and Data Types
Multidimensional Arrays, Sets, Dictionaries
Extending functionality using Collections
ASP.NET REST Services SoftUni Team ASP.NET REST Services
Exporting and Importing Data
Making big SPA applications
Manual Mapping and AutoMapper Library
C# Advanced Course Introduction SoftUni Team C# Technical Trainers
Course Overview, Trainers, Evaluation
Exporting and Importing Data
CSS Transitions and Animations
Train the Trainers Course
Directives & Forms Capturing User Input SoftUni Team
Version Control Systems
JavaScript Frameworks & AngularJS
Polymorphism, Interfaces, Abstract Classes
Lean .NET stack for building modern web apps
JavaScript: ExpressJS Overview
CSS Transitions and Animations
Presentation transcript:

Introduction to TypeScript & Angular Why Angular & How To Get Started Angular Development SoftUni Team Technical Trainers Software University http://softuni.bg

Table of Contents Why Angular? Introduction to TypeScript Installation Why Angular is better than the others Introduction to TypeScript Installation A simple process to get started Building our first application The usual Hello World app

Have a Question? sli.do #angular-js

What The Fuzz Is All About Why Angular? What The Fuzz Is All About

Why Angular? Angular is: Easy to learn Modern codebase Component-based Uses TypeScript IDE friendly Performance oriented Mobile first

Why Angular? Reasons to use Angular: Solid community Backed by Google MVC pattern Good flexibility Dependency injection Saves a lot of time Effective data binding

Introduction To TypeScript A JavaScript superset

Introduction To TypeScript Install globally TypeScript Open your IDE (Visual Studio Code understands TS) Create your first ".ts" file Write some TypeScript Run the compiler You have JavaScript npm install -g typescript tsc myfile.ts

Introduction To TypeScript Lets start with simple JavaScript function Greeter(greeting) { this.greeting = greeting; } Greeter.prototype.greet = function() { return "Hello, " + this.greeting; let greeter = new Greeter("world"); let greeting = greeter.greet(); console.log(greeting)

Introduction To TypeScript Adding types function Greeter(greeting: string) { this.greeting = greeting; } Greeter.prototype.greet = function() { return "Hello, " + this.greeting; let greeter = new Greeter("world"); let greeting = greeter.greet(); console.log(greeting)

Introduction To TypeScript Adding classes class Greeter { private greeting: string; constructor (greeting: string) { this.greeting = greeting } greet () { return 'Hello, ' + this.greeting let greeter = new Greeter('world') let greeting = greeter.greet() console.log(greeting)

Introduction To TypeScript Adding interfaces interface Person { firstName: string, lastname: string } function sayHello (person: Person) { return 'Hello from ' + person.firstName + ' ' + person.lastname let hello = sayHello({ firstName: 'Ivaylo', lastname: 'Kenov' }) console.log(hello)

Introduction To TypeScript Adding unions type nameOrNameArray = string | string[]; function sayHello (name: nameOrNameArray) { if (typeof name === 'string') { console.log(name); } else { console.log(name.join(' ')); } sayHello(['Ivaylo', 'Kenov'])

Introduction To TypeScript Other features private, public or protected modifiers readonly modifier get or set for properties static methods and properties abstract classes enum data type and many more here: https://www.typescriptlang.org/docs/handbook/basic-types.html

It's very simple actually Let's Install It It's very simple actually

Creating A New App Pretty easy actually Install globally @angular/cli Use it like this These commands will start a dev server on port 4200 To make production build just run More here: https://github.com/angular/angular-cli/wiki npm install -g @angular/cli ng new some-app cd some-app npm install ng serve ng build --prod ng serve --prod

What About The IDE? We will use Visual Studio Code But you may use whichever IDE you prefer You don't need to install anything specifically It supports TypeScript out of the box By using the Angular CLI You do not need to use a linter You do not need install any specific plugin Everything is included

Let's Hack Some Code A simple Hello World!

JavaScript Web – Angular Fundamentals https://softuni.bg/courses/angular-2-fundamentals © Software University Foundation – http://softuni.org This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike license.

License This course (slides, examples, demos, videos, homework, etc.) is licensed under the "Creative Commons Attribution- NonCommercial-ShareAlike 4.0 International" license Attribution: this work may contain portions from "End-to-end JavaScript Applications" course by Telerik Academy under CC-BY-NC-SA license © Software University Foundation – http://softuni.org This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike license.

Free Trainings @ Software University Software University Foundation – softuni.org Software University – High-Quality Education, Profession and Job for Software Developers softuni.bg Software University @ Facebook facebook.com/SoftwareUniversity Software University @ YouTube youtube.com/SoftwareUniversity Software University Forums – forum.softuni.bg © Software University Foundation – http://softuni.org This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike license.