Created
April 29, 2017 17:38
-
-
Save Whistler092/e7b4ca938b4f4e4554a259c79d7ebce3 to your computer and use it in GitHub Desktop.
Curso de Angular2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Tipos de Variables en TypeScript | |
//Variables primitivas | |
var full_name:string = "Ramiro bedoya"; | |
var age:number = 27; | |
var developer : boolean = true; | |
//arays | |
var skylls:Array<string> = ['Javascript', 'Typescript', 'Angular']; | |
var numberArray:number[] = [123,123,123,234]; | |
enum Role { Employee, Manager, Admin }; | |
var rol:Role = Role.Emproyee; | |
console.log("roles", role); | |
//No Retornar nada. | |
functin setName(name:string):void { | |
this.full_name = name; | |
} | |
//Retornar un String | |
function getHello(pretext:string):string{ | |
return pretext + " " + this.full_name; | |
} | |
function inConsole(nameFunction:any):void{ | |
console.log(nameFunction); | |
} | |
inConsole(getHello('Texto dentro del getHello')); | |
inConsole(full_name); | |
inConsole('Hola soy un simple String'); | |
var data:string [] = ['AngularJS', 'Angular', 'Redux', 'ReactJS']; | |
data.forEach( | |
(frameworksLibs)=>{ | |
this.inConsole(frameworksLibs); | |
} | |
) | |
## Pasos de Instalación | |
1. Instalar Node | |
2. En la consola instalar TypeScript | |
```npm install -g typescript``` | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment