Most voted "angular" questions
Angular is a framework created by Google for the development of web applications. Use this tag for questions about syntax, errors, doubts, among others. Not specific to a version. For Angularjs-related issues (1.X) use the Angularjs tag.
Learn more…2,063 questions
Sort by count of
-
2
votes2
answers106
viewsHow to replace the value of a string from a certain character?
I have a variable called nameImage. It is named after a photo. Ex: photo.png I need to remove everything after png, getting just the "photo". I tried to:…
-
2
votes1
answer453
viewsHow to put maximum value in a Date field in Angular 7?
Look at the picture; You can see from the image that the field is accepting more than ten digits, what I need to do is allow the user to only type ten digits in the data field, I’m having difficulty…
-
2
votes1
answer746
viewsHow to limit an input of type Number to only 3 characters by Angular 7?
I have a problem with a variable of type integer, because maxlength="" only works with string and need to bar, but is of type Number. I think you need javascript, if anyone knows the solution would…
-
2
votes1
answer204
viewsIs it possible to define the return type of a Promise?
Good morning. I wonder if it is possible to define the return type of a Promise with typescript. I need this because I have a function that returns a precedent for a query in the database and I need…
-
2
votes2
answers193
viewsSegregate CSS in the construction of Angular components?
I have a reusable component (main), it would be something like a widget, that the main structure is separated into 3 parts (or sub-components), which will not be reused anywhere else but the main…
-
2
votes1
answer295
viewsDrag and drop with Angular CDK - Keep items in position after page refresh
I’m doing an angled drag & drop, but one of the rules I need in the application is that the item stays in the same place after the page is reloaded. Something more or less like the image. HTML…
-
2
votes2
answers253
viewsAbnormal behavior when taking data from a Formgroup with Angular
I was finishing a form using Angular and Materialize and noticed that I was not receiving the data from fields generated with "datepicker" of Materialize, even if they have valid text. HTML:…
-
2
votes1
answer342
viewsSelect is not initialized with default value
I created a component that has a type field <select> and receives a property [modelo] as input: if the template is null, the form is initialized empty; if it has content, it is initialized for…
-
2
votes1
answer167
viewsAnchor effect on a dynamically charged component at Angular
Hello. I use version 8.1.3 of Angular in my project and am having some problems creating an anchor effect on the product card that is dynamically loaded onto the screen. I tried using old html with…
-
2
votes1
answer155
viewsDoubt with Nested Observables (Angular 8 & Ionic 4)
Good afternoon, I would like guidance on the Observables. I’m making an app for learning, where I insert products in a shopping cart, these products in case would be vegetables. I will try to be…
-
2
votes1
answer100
viewsProblem with Http Request Angular
Iae galera! Look, I have a code here that’s gets the user data when he types in his CPF, I recently started using Async functions. the idea of Async would not only be to perform the function from…
-
2
votes2
answers58
viewsJavascript function being called too early
I have a registration form that has, among others, the following field: <div id="Aditivo" class="col-xs-12 col-md-2"> @Html.LabelFor(model => model.NumeroAditivo, new { @class =…
-
2
votes2
answers695
viewsHow to apply a *ngFor to an array of objects in Angular where the name varies?
I have the following array called dadosRelatorio that I need to iterate in my template, that array I get through a request from my backend. [{"id": 1, "name": "a", "class":[{ "Inglês":[{ "id": 1,…
-
2
votes1
answer360
viewsMake input mandatory based on previous input
Guys who can help me, I appreciate. I have some reactive fields in my code, they become mandatory or not based on the previous field, my code is like this <div class="ui-g-12 ui-md-4">…
-
2
votes1
answer58
viewsHow do I use ngFor with a Javascript dictionary?
I’m trying to generate a dynamic page with Angular 9, my idea is every key in the dictionary create an optgoup tag and each value an option, but I’m not able to access the values of the Dict object.…
-
2
votes0
answers175
viewsSharing Components and Services between Modules
In the development of Angular projects, it is common to share components and services between the various modules that the application may have. When it comes to services, Angular projects tend to…
-
2
votes0
answers85
viewsDoubts about authentication for a Java application with Spring Security (stateless)
I will start a new project and came to doubt regarding the best way to work the authentication/authorization part. The project will be developed in Java with spring (boot), backend and frontend…
-
2
votes1
answer161
viewsAdd javascript plugins at angular 7
I’m trying to plot a hierarchy chart on the page using a plugin Angular from this tutorial. Even looking at the demo and trying to put them that way When I load the page, the page does not work...…
javascript jquery angular angular-7 hierarchical-dataasked 4 years, 7 months ago adventistaam 3,354 -
2
votes1
answer83
viewsMat-Paginator out of position after Chrome update
Good afternoon, everyone, I use Angular 6.1.5 with Angular-Material 6.4.7, and about 2 months after a Google Chrome update mat-Paginator moved to position 9 "nine" in the table, staying in the…
-
2
votes0
answers64
viewsLoad JST Manual
I have an application in MVC that works perfectly, where it uses JST, and it loads everything right, this way: But now I’m adding this part in angular, and I can’t load the templates, I thought to…
-
1
votes0
answers797
viewsMask or format input value at angular2
How can I format or use masks on inputs with angular2, for example for money In this input: <input type="text" class="form-control input-sm text-right" id="representPercDiagnostico"…
-
1
votes1
answer167
viewsError with http.post and http.get with Angular 2
Well, I’m having a problem sending and retrieving data with Angular 2. Auth.ts import {Observable} from 'rxjs/Observable'; import {Injectable} from "angular2/core"; import {Http, Response} from…
-
1
votes0
answers409
viewsKeep valid Angular2 routes(URL)
I am starting the studies at Angular 2 and found a possible limitation that does not seem interesting for my application use case, because it seems to me it is not possible to reconstruct the state…
angularasked 8 years, 10 months ago Fernando Leal 9,770 -
1
votes0
answers354
viewsNodejs for real-time applications
Recently, with the arrival of Angular2 beta, I have been looking for more information about real-time applications. Currently I work with AngularJs (1.x) in the front-end with apache server in MySql…
-
1
votes1
answer1626
viewsaccess port problem in Node.js
I’m trying to learn about angular2, and I’m facing this problem. when I type : "live-server" this error appears to me below: live-server Error: listen EACCES 0.0.0.0:8080 I try to type the command…
-
1
votes0
answers103
viewsFailed to receive native Ionic 2 Push notifications
I’m developing an application using Ionic 2/Angular 2/Typescript. This application uses Ionic 2’s native push notifications plugin and Google Cloud Message (GCM) in conjunction with Amazon SNS. The…
angular push-notification ionic2 google-cloud-messaging snsasked 8 years, 6 months ago Natanael 131 -
1
votes1
answer1674
viewsRequest header field Content-Type is not allowed by Access-Control-Allow-Headers in preflight
How can I eliminate this mistake? XMLHttpRequest cannot load http://www.ramosdainformatica.com.br/food/apinhac.php. Request header field Content-Type is not allowed by Access-Control-Allow-Headers…
-
1
votes1
answer1654
viewsHow to clean or reset form with Angular2
How can I clear the fields of a form with Angular2? I need to reset the form I’m using the final version of angular 2 in my design
-
1
votes2
answers2784
viewsHow to get the return (value) of a Promise in Javascript / Typescript?
I’m starting with Ionic 2, which uses Angular 2, and I’m trying to understand how Promises work, because some libs I’m using work have functions that return Promises and would like to get the value…
-
1
votes1
answer1147
viewsInstall IOS app without having to go up in the store
Is it possible to install an IOS app without having to go up in the store? Just like I can just download the . apk and install on android? An example of what I’m talking about:…
-
1
votes1
answer344
viewsWhenever I use this error Syntaxerror: Unexpected token
car-master.component.ts import {Component} from '@angular/core'; import {Car} from './car'; import {CarDetailComponent} from './car-detail.Component'; @Component({ selector: 'my-car', templateUrl:…
-
1
votes1
answer738
viewsInject token into the header of all http requests
I am trying to create a general method to insert a token in all my http requests. I don’t know much about angular 2 but I did it the way below: Filing cabinet generic-service.ts import {Http,…
-
1
votes1
answer85
viewshttp post error
Friends, I would like to have the save method in the class itself, and I’m not getting it, I’m beginner in typescript. import { Injectable } from '@angular/core'; import { Http } from…
-
1
votes0
answers81
viewsWhat is the best Practice to share code between angular 2 Projects?
What is the best Practice to share code between angular 2 Projects? How can I share Components between Projects? Below Dashboard example should be use Components of the eye project, and Nose…
-
1
votes1
answer183
viewsIonic 2 - Any type variables
I’m having trouble migrating from Ionic beta.11 to RC0. Every time I put a constructor waiting for type "any" I get the following error. Ngc error: Error: Error at /Projeto/.…
-
1
votes0
answers388
viewsRendering error with angular router 2
I’m studying Angular 2 and I came across a problem in the application I’m doing as a study. I decided to create a Coremodule and in it create a Sidebar(menu) component with the links for navigation…
-
1
votes1
answer786
viewsNg build -Prod Angular 2 - How to publish the application
after giving Ng build -Prod it generates files for distribution, my question is the following how can I publish it on a PHP server or any other normal, because when I try to get the files generated…
-
1
votes1
answer822
viewsPass html page id inside ngFor to ts page
I have a *ngFor of an array object, I want to pass the id inside the button to typescript to configure it as links in a modal. Follow the syntax I’m trying with no success: <ion-item *ngFor="let…
-
1
votes1
answer2538
viewsnpm install -g angular-cli shows error
Before I was presenting a message that git couldn’t be found, so I reinstalled, fixed the PATH, but now it presents another error message, someone can suggest me what to do? Binary is fine; exiting.…
-
1
votes1
answer304
viewsion-toggle how to fire event when scoring
I have following code: <ion-item *ngFor="let dispositivo of dispositivos"> <ion-label>{{dispositivo.Nome}}</ion-label> <ion-toggle toggle-class="toggle-positive"…
-
1
votes1
answer698
viewsChange Real Angular Mask 2
I have a field with value formatted with currency 'BRL':'true:'2.0-0'. The value it brings me is like this: R$ 500,000,000. I would like to know how to leave as follows: 500,000,000.
-
1
votes1
answer734
viewsService variable comes as UNDEFINED in Angular Component 2
I’m not getting a variable from a service at 2. I have companies-index.component.ts and companies-crud.service.ts. I would like to take a service variable in Component but it always comes as…
-
1
votes1
answer244
viewsReceive multiple inputs in html tag with Angular 2
In my Component app, I am sending the following inputs to html. How do I receive all of them in html? export class AppComponent { nomeRedeSocial: string = "Minha Rede Social"; linhaDoTempo: string =…
-
1
votes0
answers200
viewsAg-grid with Angular2 using angular-cli
I am trying to run ag-grid with angular2, the examples you have on the ag-grid website are using Systemjs as Builder, and the new angular-cli uses webpack. Below I’ll put the way I managed to run,…
-
1
votes1
answer352
viewsHow do I increment days to a date in Ionic 2
I don’t have much experience with Javascript dates, nor with the frameworks mentioned: For now what I managed was to display the current date on the front end using the following syntax: this.myDate…
-
1
votes1
answer285
views -
1
votes0
answers483
viewsSave value to a variable
How can I save the value of a calculation done in front-end by passing to a variable in typescript, example: Typescript: valor:number=0; html: <ion-input type="number"…
-
1
votes0
answers158
viewsHow to generate multiple modals in Angular 2 for the same view in Ionic?
sorry ignorance may not have formulated the question correctly, a week ago I started to see a little about Ionic and Angular 2, I came doing some tests and came across the following problem.…
-
1
votes1
answer258
viewsPage does not load elements when updating to Ionic 2
Well I have an app with side menu where the first page is the home, and it loads elements as soon as the user enters the app. I’m using Ionic 2 and communication is being done via socket. One detail…
-
1
votes1
answer212
viewsAngular asynchronous responses 4
I’m making a request, and I’m waiting for a return, however it is asynchronous, may or may not, in my case I just want to display a message on the screen. Time she send undefined and hours returns…