Most voted "typescript" questions
Typescript is a super superset of Javascript created by Microsoft that adds optional types, classes, interfaces and modules and compiles for pure Javascript.
Learn more…1,167 questions
Sort by count of
-
1
votes1
answer146
viewsImport inline SVG from Absolute path in Next.JS
I’m having trouble setting up Next.Js to make imports on absolute camino. I set up the tsconfig.json using the baseUrl as "src" and even works except in inline SVG files. I am using the…
-
1
votes2
answers42
viewsMethod returns [Object Object]
I am building an application that should create a list of Pokemons, but I have the following problems: My table that should display the Pokemon list does not display anything. When I do the…
-
1
votes0
answers69
viewsProperty 'utm' does not exist on type 'typeof
Greetings, I am beginner in both Angular and Typescript I come from java. I’m doing the front-end of a project using Angular 10, in it use leaflet to display maps but a need to install dependency…
-
1
votes1
answer266
viewsFloating promise check in Typescript Eslint (no floating Promises)
I have the following method: async sync({model, event, data}: {model: string, event: string, data: Category}) { if (model === 'category') { switch (event) { case 'created': await…
-
1
votes0
answers22
viewscss dynamically angular 8
I’m having a problem registering my dynamic css tried to leave extension . scss and . css but both did not work. Theme.service.ts import { Injectable, Inject, EventEmitter } from '@angular/core';…
-
1
votes1
answer104
viewsHow to Force Prettier to Always Put a Multilevel Ternary
I am creating an application using Vscode as IDE and, to do the lint of the code, I’m using the Eslint and the GTS (Google Typescript Style) where in a code location I have something similar to…
-
1
votes1
answer175
viewsHow to create a search bar with Angular (typescript)?
I have a code that is a Kanban and I need to apply a filter to find its titles (which for now is in the component), I would like to create a search bar that works only on the front end, because I…
-
1
votes0
answers23
viewsHow to test a "await import" with Jest in Typescript
I have an api that in the file that imports the routes to then link them to the express app I use fast-glob to search for files with the extension *.route.ts and then import these methods, like…
-
1
votes1
answer94
viewsAngular: Cannot link 'formGroup' as it is not a known form property
I’m making a small app, which takes a message typed in the form and records it on the console. I tried to import several items and found similar problems to mine on the internet but they did not…
-
1
votes1
answer44
viewsError in socket.io "expression cannot be called" in React/Next
I’m trying to make a Real Time Chat with socket.io with Next.js, but when it comes to importing and putting as constant is returning an error, I don’t understand because I’m about to make this code…
-
1
votes0
answers48
viewsSQL Join with typeorm
Look at this, I have the following structure of entities: Entity/Ticket.ts import {Entity, PrimaryColumn, Column, OneToMany, ManyToOne, OneToOne, JoinColumn} from "typeorm"; import { Academia } from…
-
1
votes0
answers28
viewsProblem with Primary Key ambiente_id instead of id in Typeorm
I am trying to create a table in the Mysql database, with Typeorm where the id is ambiente_id (nome da tabela + _ + id). Error: ER_WRONG_AUTO_KEY: Incorrect table Definition; there can be only one…
-
1
votes1
answer28
viewsTextarea problem that I use inside a map using React
I don’t have much experience with reactjs, but I’m doing a project that uses this lib, using typescript as a language. The problem is this, even before I used a map to render the elements of an…
-
1
votes0
answers72
viewsReact-spring useTransitions Error no typescript
I’m having a problem, replicating a code I saw on the net, but he’s giving me a typo on Typescript. The code is exactly the same, but is returning me error in typing Props and I can’t seem to fix…
-
1
votes1
answer37
viewsThe property this is returning Undefined in typescript
hello! I have this code typescript: import { InternalService } from './../services/InternalServices'; import { Request, Response } from "express"; class InternalController { internalService = new…
-
1
votes1
answer55
viewsHow to create a type from a variable in Typescript?
I need to create a type that, according to the variable value, uses a specific type. I have the following constant variables: const NEW = 'NEW_PROJECT'; const DELETE = 'DELETE_PROJECT'; The code is…
-
1
votes1
answer37
viewsCast from Object for an object created in Typescript
Problem Good afternoon! it is possible, in typescript, to give a cast of a object to a class I created? I need precisely to validate whether the fields exist or not, and if they are filled in…
-
1
votes0
answers43
viewsProblem with findOne verification
I am using typeorm and postgres. In my use case I have a execute method: async execute({ name, email, password }: ICreateUserDTO): Promise<void> { const userExists = await…
-
1
votes1
answer20
viewsHow to return a list of specific fields in an Aggregation in Mongodb
Hello I am creating a generic query according to the code below: // dados de exemplo em uma coleção "test" do mongodb const test = [ { "name": "foo", age: 2 }, { "name": "bar", age: 16 }, { "name":…
-
0
votes1
answer201
viewsLightbox in Angularjs 2
I’m still very inexperienced with Angularjs and so I stick to simple things. I need to use the Lightbox on a project. "Googlando" around, I found the angular-bootstrap-lightbox, but then I came…
-
0
votes1
answer397
viewsDifference between two arrays with Typescript or ES6
How can I get the difference between two Arrays of objects using TypeScript or ES6? I tried to do using SET: let arr1 = new Set(lista1); let arr2 = new Set(lista2); let difference = new Set( [arr1…
-
0
votes1
answer527
viewsRequest HTTP Ionic 2 GET
Good afternoon guys, use Ionic 2 and how can I make a request get (without Provider nd only in class ts)? I just need you to take what’s written on the page and display on an Alert. How can I do…
-
0
votes1
answer901
viewsCheck if dictionary is null or empty?
In a return of a method I have a resulting dictionary, sometimes it may come empty, hence I’m having trouble identifying when it is empty or not. for(var i = 1; i <= this.last; i++) {…
-
0
votes2
answers182
viewsIonic 2 Reading json
Personal I’m trying to read a json on Ionic, I created the service as follows : http://pastebin.com/0btbuC83 my class is like this : http://pastebin.com/6gdpBth4 and my json is like this :…
-
0
votes0
answers80
viewsHow to publish an API written in Typescript on Npmjs?
I created an API in Typescript just a short time ago. And I would like to know how you publish it in Npmjs, I know you have how to publish because Angular 2 low libs in Typescript. I don’t know…
-
0
votes1
answer351
viewsShow no 401 (Unauthorized) error on console
I created a api using the passport do laravel 5.3. It works as follows: O angular 2 send credentials to the laravel, the verification and the laravel returns a token. It’s all working round.…
-
0
votes0
answers2078
viewsngModel with variable value
Use Ionic 2, I need ngmodel to have a value of a class variable, but error when placing in view, follow my code: viiew <ion-navbar *navbar> <ion-title> POSimplex </ion-title>…
-
0
votes1
answer169
viewsIonic 2 http request error
I need to request a webserver in Ionic 2 and I have the following code : constructor(private navController: NavController, public http: Http) { var url = 'http://localhost/APIPortManager/teste.php';…
-
0
votes1
answer108
viewsParallelism with Angular 2
I need to insert 30,000 records into the device (in Sqlite) through a file. But at the time of insertion, the application hangs. So I thought about creating an asynchronous service, but I don’t know…
-
0
votes1
answer766
viewsDynamic routes with angular 2
I am developing an angular2 application and wanted to create dynamic routes, which would be generated from a .json.file. Searching I found the following code: import { Routes ,RouterModule } from…
-
0
votes1
answer192
viewsAutomatic deploy of Android and Ios apps
Would anyone know if there is an automatic deploy tool for Android and Ios applications. Any tool where I can tell him what my project folder is, and when I have deploy run, he already manages the…
-
0
votes0
answers72
viewsHow to check the value in 3rd layer in Firebase with angularfire2?
I can check the values up to the second layer, when it arrives at the third place where the array of objects comes, I cannot print the key value "fileName" How can I return the value for the…
-
0
votes1
answer1226
viewsHow to create an object and fill with data returned from Firebse?
Gist Referring to the question I have an Event class, and a method q is called snapdbEvents(), but when I put the object inside and try to define the values of the variables in the object occurs the…
-
0
votes0
answers108
viewsIonic 2 Typescript error while compiling
I am making the construction of the side menu (side-menu) the first step of inserting the button and the first tab was quiet, but in the opening part of these tabs as for example "page one" or "page…
-
0
votes1
answer83
views$watch in Typescript
I need that after I start the application it runs a set of functions every 20 seconds or each time q a json is updated,in angular 1 had the $watch that could be used for such functionality,in…
-
0
votes1
answer113
viewsHow do I add an animation while loading an Angular 4 request?
My service is like this: export class ServicoService { constructor(private http:Http) { } public listar() { return this.http.get('aqui a url') .toPromise() .then(response => response.json()); } }…
-
0
votes0
answers43
viewsI emulated my project IONIC 2 on android and it from ERRO
I emulated my project IONIC 2 on android and got the white screen and appeared the following ERROR: EXCEPTION: Error in ./MyApp class MyApp - inline template:16:2 caused by: Connection is not…
-
0
votes1
answer408
viewsDTO - Interface x Class
I have used Interface to create DTO (Data Transfer Objects), "dumb" objects that only serve to standardize the communication of objects between the front and back. My question is this: Is actually…
-
0
votes1
answer39
viewsInclude components in different parts of the page
Suppose I have the following structure: <table> <tbody> </tbody> </table> <form> </form> The pages that inherit this template will define which rows and columns…
-
0
votes1
answer2019
viewsFormat date with Angular Datepipe
I have a date in timestamp format and wanted to format for text in Portuguese, for example: "Wednesday, October 18th, 2017", but I put the pipe "| date:'fullDate'" and it doesn’t work. When I take…
-
0
votes1
answer69
viewsThe oauth_consumer_key parameter is missing
did the site installation of wordpress I have my api working locally. I’m in the wrong: polyfills.js:3 GET…
-
0
votes0
answers284
viewsMascara no Ionic
Good morning people, I wanted a help, in the ion-input of Ionic, I would like to use mask, cell number and Cpf for example, could help me with a very simple example, I use Ionic 3 and angular 4…
-
0
votes1
answer138
viewsChange color of the clear input "X" icon
I need to change the color of the "X" icon linked to this input: <ion-item> <ion-input placeholder="Clear Input" clearInput></ion-input> </ion-item> So far, by the search I…
-
0
votes1
answer297
viewsIonic - request api php
Guys I’m trying to make a request will post on a php api, it returns me Undefined. My predecessor: import { Injectable } from '@angular/core'; import { Http } from '@angular/http'; import…
-
0
votes0
answers115
viewsIonic 2 network.type = null
I am developing an application in Ionic 2 ts, but when I try to check if it is connected on the internet it returns null. My code import { Network } from '@ionic-native/network'; @Component({…
-
0
votes2
answers950
viewsIs there any method for me to create translations of pages with Javascript or Typescript?
I wonder if there is any method for me to create my own translations of static pages with Javascript.
-
0
votes0
answers99
viewsWhy is it necessary to use "result as T" in the return of a generic method?
Consider the following method: private handleError<T> (operation = 'operation', result?: T) { return (error: any): Observable<T> => { this.log(`${operation} failed:…
-
0
votes1
answer401
viewsError trying to run the app with Ionic serves
When trying to run the app with Ionic serves this giving the following error: > ionic-hello-world@ ionic:serve D:\www\mobile\app > ionic-app-scripts serve "--v2" "undefined" "--address"…
-
0
votes2
answers137
viewsAngular 4 - Input / Output Access parent event via Typescript
At Angular 4, how do I access the functions of the parent being in the child or the functions of the child being in the direct parent by Typescript instead of traditionally accessing via tag…
-
0
votes1
answer536
viewsCreate Angular and Firebase reports
What to use to create reports with Angular and Firebase? I have an application in the area of health with Angular and Firebase, I’m coming in the part of system reports and would like alternatives…