Questions tagged as 'typescript'

1
answer

How to install the TypeScript Plugin in Sublime Text 3?

I'm trying to install the plugin in Sublime Text 3, and for this I did the steps: I installed the GIT I ran the available commands here in the GIT terminal. IpressedControl+Shift+PtoseeifitwasTypeScript,butnothingappears....
asked by 19.01.2018 / 13:04
1
answer

What does "Tree-Shaking" mean?

I closely follow all the development of the Angular. I know that the third generation of the rendering engine ( Ivy , codenamed for Render 3) will launch soon. Overall, the goals for this new renderer are: Asyoucanseeinthediagramabove,oneoft...
asked by 26.07.2018 / 04:07
1
answer

Why does TypeScript when compiled, convert "let" to "var" in variables?

If let variavel = "valor"; is also supported in JavaScript , because in TypeScript compilation, it transforms to var variavel = "valor" ? Take the test right here : function foo(){ var x = 1; let y = 3; if (true){...
asked by 20.08.2018 / 22:14
2
answers

How can I implement the GroupBy method in TypeScript?

I have an array: interface IFoo { IDCidade: number; Nome: string } var arr = [ { IDCidade: 10, Nome: "Foo" }, { IDCidade: 10, Nome: "Bar" }, { IDCidade: 20, Nome: "Foo" }, { IDCidade: 20, Nome: "Bar" } ]; I want to group t...
asked by 14.12.2013 / 22:58
1
answer

How to convert an object vector to another object?

I wanted to know if there is any simple way to convert a vector of objects A to a vector of objects of type B, which follow the second structure: Object A { aId: number; aNome: string; aDesc: string; } Object B { bId: n...
asked by 01.11.2017 / 18:07
1
answer

Change function with ion-selection-option

Alright? I'm having difficulties, I hope you can help me ... I'm studying Ionic 2 very soon and thought of making a simple application. In JavaScript I did it quietly, but with Ionic does not work. It is the onChange () method that in ionic I be...
asked by 09.05.2017 / 02:23
1
answer

How to disable XHR messages from loading in production

I have a system developed in Angular language in version 4. The system that generates application build in production is the webpack. The following starter is used as the base: angular 4 webpack starter The system is finished, but has the foll...
asked by 04.10.2017 / 15:35
2
answers

How to create a static method in a public class?

I would like to create a static method in a public class with a ToastController so that I can access this method across multiple classes. I tried to do it this way but it did not work: export class Utils { constructor(public toastCtr...
asked by 08.02.2017 / 20:31
1
answer

How to remove a page from Ionic navigation 2/3

In a hybrid application with Ionic 3 I have 3 pages that are part of the process of buying a product. The process is as follows: The user is in the cart and clicks the "Choose payment method" button If he is logged in is redirected to...
asked by 06.11.2017 / 21:32
2
answers

How to read a JSON file dynamically? (ANGULAR 2)

For example, when I start, I want my program to load all previously stored messages into a JSON (message.json) file. ngOnInit() { this.emissor = 'Victor'; this._http.get<PreparacaoDeMensagem[]>("../assets/db/mensagem.json") .subscribe(...
asked by 02.10.2018 / 01:10