Questions tagged [angular]

77676 questions
1

votes
3

answer
1.3k

Views

How to integrate intro.js with angular2 cli?

EXCEPTION: Uncaught (in promise): Error: Error in :0:0 caused by: Cannot read property 'introJs' of undefined Error: Error in :0:0 caused by: Cannot read property 'introJs' of undefined
user121407
1

votes
2

answer
3.3k

Views

Failed to execute 'setRequestHeader' on 'XMLHttpRequest': The object's state must be OPENED

I have been developing an angular application with restful API get(). I have got few errors like unauthorization error:401 which has been solved. Now I am getting this error which is kind of straight-forward. I have tried added CORS package as well. I have been searching for solutions which are in v...
cantona_7
0

votes
1

answer
24

Views

will Usage of BehaviorSubjects frequently, impact on Application performance?

I am using Angular7.x in our application. Using number of BehaviourSubjects are keep on increasing. will it effect Application performance? If so please provide any other alternative for BehaviourSubjects.
Santhosh
1

votes
0

answer
6

Views

Different handling of basic authentication in rest client and web app in browser

I have angular frontend and spring backend. I'm using spring security to hande http basic authentication. I noticed strange difference in behaviour using advanced rest client(or any other) and angular web app. For tests I disabled my httpInterceptor so it is not including 'Authorisation: Basic fooba...
skoomi
2

votes
0

answer
20

Views

to change the tab index of mat-stepper using output

i am using mat-stepper for my view and in each mat-step there is a component with form. when my form gets submitted i am passing an event using @output and receiving in parent component and incrementing the index of mat-stepper using stepper.next() but it is now incrementing for the first time it is...
subhashish negi
1

votes
2

answer
73

Views

Why do I have to start some scripts with “npm start x” and others with “npm x” only?

In my package.json, I have the following part for script definition. 'scripts': { 'ng': 'ng', 'start': 'ng serve', 'build': 'ng build --prod', 'test': 'ng test', 'lint': 'ng lint', 'e2e': 'ng e2e' }, ... Whenever I want to run the app, I go npm start (which executes ng serve). I can also go npm run...
DonkeyBanana
1

votes
2

answer
1.5k

Views

By default open ion-fab-list

I need top open ion-fab-list open by-default when the ionic page loads. Please provide some help. I have tried following solutions but did not work: 1. write (click) event on fab-button in .html and call event from .ts. ionViewDidEnter() { this.calculateButtons(); } calculateButtons() { // butto...
Punita
1

votes
1

answer
1.3k

Views

Angular-Redux Epics

Getting the following error message in console when using the angular-redux library. Also, Redux won't catch or listen for actions after the error occurs. I've searched, including the documentation but nothing points out to fix the error. Am I missing something? Error core.js:1427 ERROR Error: Actio...
Ben Isaac
1

votes
1

answer
4.5k

Views

How to download an excel (xlsx) file using Angular 5 HttpClient get method with Node/Express backend?

I have an excel file in a directory on my nodejs server - Path to the file is - ./api/uploads/appsecuritydesign/output/appsecdesign.xlsx On click of a button in my Angular 5 component I am just trying to download the file using FileSaver. Below is my Angular component. Here the template code for th...
Aakash
1

votes
1

answer
1.3k

Views

Angular4 reload component when URL changes

I didn't find accepted answers to similar questions, so please don't mark it as a duplicate. I have a 'request-summary' component and 'search' component. 'Search' component is rendered as a pop-up window in 'request-summary' component. I need to click on a matching result in search component and bei...
Anna Olshevskaia
1

votes
1

answer
2.8k

Views

Angular - Access values of object stored in array of objects inside template

I've got a single class as below: export class SettingsTab { id: number; class: string; name: Object = {}; } Also I mock it into simple array: export const SETTINGSTABS: SettingsTab[] = [ { id: 1, class: 'classOne', name: [{ 'pl': 'Tekst po polsku' }, { 'en': 'Text in english' }] }, { id: 2, class:...
Ashiv3r
1

votes
1

answer
896

Views

Argument of type 'string[]' is not assignable to parameter of type 'ReadonlyArray<number>'

I am trying to learn d3.js from this tutorial I draw figures using d3.js in angular but I am getting stuck here. can anyone please tell me how can I solve this error. I am having only one method drawSvg() and I am getting an error which is Argument of type 'string[]' is not assignable to parameter...
Humble Dolt
1

votes
1

answer
2.4k

Views

How can i get selected value from a select component

How can I get the selected value from a select component? select.component.ts: export class PfSelectComponent implements OnInit { constructor() { } ngOnInit() { } @Input() options : Array; } select.component.html {{option.name}} select value: {{selectedValue}} {{selectValue}} does not show the value...
Rafael Augusto
1

votes
2

answer
1.6k

Views

There is no FormControl instance attached to form control element with name

I have created a form in Angular 2 with which users can edit a SearchProfile which they can select from a list. Initially everything works fine but when i select a different item from the list of SearchProfiles I receive the following exception: There is no FormControl instance attached to form cont...
Bunnynut
1

votes
2

answer
8.7k

Views

How to solve Cross-Origin-Request-Block issue while fetching data using angular2 and php?

Please read the question in detail since it is a long one with various edits and extended updates as per the request of other users. I am trying to send data to php file using angular2. I am doing the angular project in Unix and the var/www/html/ is the php Xampp folder locations for running the ph...
Saswat
1

votes
1

answer
1.6k

Views

angular 5, how do I return an array from a promise?

I am creating an array, after it is created that array is resolved as a Object. However as I need to sort tempArray based on a particular value after the resolve I need it as an array, not an Object. Also because after the sort I am displaying it using: *ngFor. Or is it better to somehow sort the...
oudekaas
1

votes
3

answer
5.2k

Views

Angular Template parse errors: The pipe could not be found

app.module.ts import { BrowserModule } from '@angular/platform-browser'; import { ErrorHandler, NgModule } from '@angular/core'; import { IonicApp, IonicErrorHandler, IonicModule } from 'ionic-angular'; import { SplashScreen } from '@ionic-native/splash-screen'; import { StatusBar } from '@ionic-nat...
shah rushabh
1

votes
3

answer
673

Views

How do i catch status code with httpClient angular

I am working with http client i have a in my service private extractData(response: HttpResponse) { const body = response; return body || {}; } private handleError(err: HttpErrorResponse) { let errorMessage: string; // A client-side or network error occurred. if (err.error instanceof Error) { error...
valik
1

votes
1

answer
342

Views

angular6: add universal support with cli

I created a new angular6 application using angular cli and then type : ng generate universal to add universal support. I works fine but I wonder why it added 'server': { 'builder': '@angular-devkit/build-angular:server', 'options': { 'outputPath': 'dist/VulogDeploy-server', 'main': 'ClientApp/main....
Dragouf
1

votes
1

answer
1.3k

Views

How to show and hide mat spinner on API call

I was trying to show mat spinner on API method call. Below is my API call code on which I subscribe to get the data, Usually it is just 2 min work but this time didn't work, also I know this happens due to a subscribe method so any easy way to implement that? this.loading = true; this.ticketModelSer...
1

votes
2

answer
1k

Views

customizing ngbAccordion

I am using NgbAccordion in one of my project and need to customise it text color property, but unable to do so. I have written the css but it is not affecting the accordion in any way. You can see my code here Also I came across this where users have mentioned that it is not possible to customise ng...
Bijay Singh
1

votes
1

answer
3.5k

Views

fixed header and scrollable body in table in html angular

In Angular i have a table and it should be scrollable. But header should be fixed. but while scrolling header is not fixed. please help
ruby
1

votes
1

answer
697

Views

Angular 4 ng-bootstrap close Modal from child component

I am using ng-bootstrap' modal and got stuck with a problem. Situation:- I have a form component that I am showing in a modal. Now, I want to close the modal once the user submits the form and backend confirms the success. problem:- As guided here, I don't have a reference of the modal in child com...
aadii104
1

votes
1

answer
597

Views

How to run Angular6 E2E tests on Alpine Linux

While trying to run E2E tests using Alpine Linux we have the following mysterious error: E/launcher - spawn (...)/selenium/chromedriver_2.40 ENOENT How to reproduce docker run -it --name my-alpine --rm alpine:latest /bin/ash apk add --update nodejs nodejs-npm chromium \ && export CHROME_BIN=/usr/bin...
hamilton.lima
1

votes
2

answer
710

Views

Angular | Creating an Observable Not Working

In Angular6, I'm creating an Injectable service. I'm trying to initialize an Observable in the constructor, see simplified code below. Problem: The callback function of Observable.create is never executed, and there is no errors. Why is console.log('authObserver created!') never called? import { O...
Vingtoft
1

votes
1

answer
379

Views

How do I fix the following error?

I wrote the following code following rxjs 6 documentation. Im currently running angular 5, rxjs 6 and angularfire2 rc.10. The error I get is [ts] property 'pipe' does not exist on type 'OperatorFunction'. This is the code this.companies$ = combineLatest(this.authService.user$, this.filter$).pipe( s...
Noober
1

votes
3

answer
1.2k

Views

ExpressionChangedAfterItHasBeenCheckedError invoking toastr in ngInit in Angular 6

After registering, user is redirected to login page, with a ?welcome=1 param in the URL so that it can display a welcoming toast. in Login component, I have: ngOnInit() { ... if (this.route.snapshot.queryParams['welcome']) { this.toastr.success('Register Successful, please login'); } } and I get hi...
1

votes
1

answer
1.8k

Views

Cannot read property 'page' of undefined when making a material paginator

I have been following the Angular Material Data Table paginator tutorial here. When they construct their paginator, they declare a paginator using @ViewChild(MatPaginator) paginator: MatPaginator; in their component.ts file. With this declaration, they are able to access properties later in the same...
Atticus29
0

votes
3

answer
29

Views

How to get value from checkbox?

Following is my template: Education when user check the box ( true ) I require to get the 'Education' as value in change event. how to get that. this is required for filter purpose. On console I am not getting value: updateCategory(event){ console.log('event', event); //? }
user2024080
2

votes
1

answer
31

Views

How to prevent checkbox to be selected when click anywhere on row?

my row get selected when i click anywhere on the row even my radio button and slide toggle, i want it to be selected only when user clicks on checkbox selection: SelectionModel = new SelectionModel(true, []); @Output() approveSelectEvent: EventEmitter = new EventEmitter(); ngOnInit() { this.selectio...
HUSSAIN
0

votes
3

answer
21

Views

How to save table filters/page after changing route?

I've got a table of reports and custom filters, pagination there. Then I change route to /:reportId. After I navigate back to the table, filters/paging are reset. How to save that on route changing only when I go back from report route(if from others, reset filters). How to hook that when I came ex...
Nate River
-1

votes
0

answer
21

Views

core.js:15724 ERROR TypeError: Cannot read property 'length' of null

core.js:15724 ERROR TypeError: Cannot read property 'length' of null at HttpHeaders.push../node_modules/@angular/common/fesm5/http.js.HttpHeaders.applyUpdate (http.js:241) at http.js:212 at Array.forEach () at HttpHeaders.push../node_modules/@angular/common/fesm5/http.js.HttpHeaders.init (http.js:21...
Sourabh Surana
0

votes
0

answer
18

Views

Angular material dialog not showing data properly

In my application am handling errors globally , if i got any error am just opening mat dialog to show error description and code. Issue is when dialog opened it showing empty after few seconds data is showing, i tested by debugging data is sending properly , but it is taking time to show error desc...
madhu Goud
0

votes
1

answer
13

Views

Cannot find a differ supporting object '[object Object]' of type 'object'. NgFor only support

I am going to receive an object like the following: BOI BOI SBH SBH BOI 2234682 bsnl 1116 SCIENTIST 'E' B Rama Krishna Reddy 51910 false A- N 01-07-1958 00:00:00 B Pulla Reddy(Late) M M and here is my interface export interface IEmployeePersonalInformation { EmployeeCode: string; EmployeeName: strin...
rammi
-1

votes
0

answer
12

Views

How to fix “forChild of undefined”

I've implemented lazy loading on my Angular 4 app, which is localy working without problems, but on production I've got errors Cannot read property 'forChild' of undefined. The thing is I can not track the problem. If I'm going to deploy app 2 times error will occur on different routes each time. I...
HC1122
0

votes
0

answer
12

Views

How to show the area without chips if there is no value

My table uses chips to input for the value under 'type'. but when there is no values in it. there still is a empty chip in it. anyone knows how i can fix this problem? [![html Type {{truck}} ][1]][1] component.ts import { Component, OnInit, ViewChild, ElementRef, Input, OnChanges } from '@angular/co...
SoberdogK9
1

votes
0

answer
9

Views

The selector “app-root” did not match any elements after update to Angular 7

After updating the client app of an ASP.Net Core MVC SPA-project from Angular 5.2 to Angular 7, I receive the following runtime error when loading the app from index.html: The selector 'app-root' did not match any elements at DefaultDomRenderer2.push../node_modules/@angular/platform-browser/fesm5/pl...
Marc
1

votes
2

answer
747

Views

Kendo UI for Angular custom sorting grid column

I have the following column in a Kendo Grid (UI for Jquery) with a special sort method based on the needs of my customers. field: 'daysLeft', title: 'Accessible', width: 130, sortable: { compare: function (a, b, descending) { if (a.daysLeft == 'Not started') return 1; if (b.daysLeft == 'Not started'...
h3li0s
1

votes
1

answer
3.7k

Views

Function implementation is missing or not immediately following the declaration, TypeScript class

I got a handwritten array to fill a table in my class, now I'm getting this array's content from a JSON on ngOnInit but it's not structured as I need. So I'm trying to write a function to fill the table array with this new one I'm getting on ngOnInit. The issue is that when I write code outside of...
prevox
1

votes
1

answer
805

Views

How to modify a file with angular schematics

Let's say we have an existing angular component including menu.component.html : home about The goal is to add a new link with angular schematics, just after 'about' contact Any ideas?
user4649102

View additional questions