This file contains hidden or 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
| export class Todo { | |
| id: number; | |
| title: string; | |
| description: string; | |
| isDone: boolean; | |
| } |
This file contains hidden or 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
| tns create ToDoAngularTypeScript --ng | |
| cd ToDoAngularTypeScript | |
| tns platform add android |
This file contains hidden or 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
| var httpModule = require("http"); | |
| httpModule.getJSON('http://site/servico.json') | |
| .then(function(retorno){ | |
| // trabalho com o retorno | |
| }); |
This file contains hidden or 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
| tns emulate ios | |
| tns emulate android |
This file contains hidden or 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
| tns platform add ios | |
| tns platform add android |
This file contains hidden or 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
| tns create [nome-aplicativo] |
This file contains hidden or 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
| npm install -g nativescript |
This file contains hidden or 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
| module Animal { | |
| export class Cachorro { | |
| private _nome: string; | |
| constructor(nome: string) { | |
| this._nome = nome; | |
| } | |
| andar(): void { | |
| console.log(this._nome + " está andando..."); | |
| } | |
| } |
This file contains hidden or 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
| class Animal { | |
| nomeAnimal: string; | |
| constructor(nome: string) { | |
| this.nomeAnimal = nome; | |
| } | |
| andar(): void { | |
| console.log(this.nomeAnimal + " está andando..."); | |
| } | |
| } | |
| class Cachorro extends Animal { |
This file contains hidden or 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
| interface ValidacoesPessoa { | |
| validaIdade(): boolean; | |
| } | |
| class Pessoa implements ValidacoesPessoa { | |
| private _idade: number; | |
| constructor(idade: number) { | |
| this._idade = idade; | |
| } | |
| imprimir(): void { | |
| if (this.validaIdade()) |