Skip to main content

Questions tagged [angular5]

Questions about Angular version 5, the web framework from Google. Use this tag for Angular questions which are specific to only version 5. Use tag Angular for any Angular questions which are not specific to an individual version.

119 votes
9 answers
247k views

Read response headers from API response - Angular 5 + TypeScript

I'm triggering a HTTP request and I'm getting a valid response from it. The response also has a header X-Token that I wish to read. I'm trying the below code to read the headers, however, I get null ...
Sahil Khanna's user avatar
  • 4,342
119 votes
8 answers
524k views

How to add CORS request in header in Angular 5

I have added the CORS in header but I am still getting the CORS issue in my request. What is the correct way to add and handle CORS and other requests in the headers? Here is service file code: ...
Aman Kumar's user avatar
  • 1,592
211 votes
45 answers
737k views

Angular CLI Error: The serve command requires to be run in an Angular project, but a project definition could not be found

When running the terminal commands ng server or ng serve --live-reload=true, I'm getting this issue: The serve command requires to be run in an Angular project, but a project definition could not ...
Gurpreet Singh's user avatar
47 votes
2 answers
152k views

How to call JavaScript functions from Typescript in Angular 5?

I'm working on PDF Viewer development in Angular 5. I'm done with writing HTML code for the UI part. Now I've JavaScript files that provide functionality for the UI elements. As Angular 5 supports ...
Ravi's user avatar
  • 1,892
218 votes
15 answers
418k views

Set focus on <input> element

I am working a front-end application with Angular 5, and I need to have a search box hidden, but on click of a button, the search box should be displayed and focused. I have tried a few ways found on ...
Bob's user avatar
  • 2,203
63 votes
6 answers
71k views

Load new modules dynamically in run-time with Angular CLI & Angular 5

Currently I'm working on a project which is being hosted on a clients server. For new 'modules' there is no intention to recompile the entire application. That said, the client wants to update the ...
Lars Meijdam's user avatar
  • 1,177
15 votes
4 answers
23k views

Compile dynamic HTML in Angular 4/5- something similar to $compile in Angular JS

I wanted to receive an HTML data via service call to server(this is for sure. I cannot keep templates in local) and manipulate them internally on how to show it(either as a modal or full page). This ...
Srini's user avatar
  • 181
44 votes
2 answers
21k views

Receive AccessDenied when trying to access a reload or refresh or one in new tab in angular 5

For a while, I was simply storing the contents of my website in a s3 bucket and could access all pages via the full url just fine. I wanted to make my website more secure by adding an SSL so I created ...
Avinash Dalvi's user avatar
9 votes
6 answers
9k views

angular-i18n work-around for translations in code?

We have to wait until Angular 6 for angular-i18n to support translations in code for error messages and such. For those that are using angular-i18n (instead of ngx-translate for instance) what are ...
Carbo's user avatar
  • 329
224 votes
20 answers
253k views

Angular 5 - Copy to clipboard

I am trying to implement an icon that when clicked will save a variable to the user's clipboard. I have currently tried several libraries and none of them have been able to do so. How do I properly ...
anonymous-dev's user avatar
44 votes
9 answers
167k views

Uncaught (in promise): Error: StaticInjectorError(AppModule)[options]

I have a strange error. Usually (I did my googling), in this case of errors Angular specifies in square brackets which exactly module/service/provider/etc caused the problem. However here, it says ...
techkuz's user avatar
  • 3,845
31 votes
2 answers
28k views

Migrating Angular 4.x to Angular 5 [duplicate]

I have read the following blogs and documentation Angular Blog Alligator IO Docs Official Documentation and no clear information about how to migrate from 4.x to 5. Tried the following commands ...
Aravind's user avatar
  • 41.2k
129 votes
21 answers
228k views

NullInjectorError: No provider for MatDialogRef

I can't inject MatDialogRef as it described in documentation: https://material.angular.io/components/dialog/overview When i'm trying to do it i'v got error: ERROR Error: StaticInjectorError[...
rc21's user avatar
  • 1,816
79 votes
3 answers
240k views

Angular 5 Reactive Forms - Radio Button Group

I have 2 radio buttons, I'm using reactive forms and I have added the form controls within my component. The issue I am facing is that the name attribute has to be the same as the formControlName. ...
Taranjit Kang's user avatar
62 votes
8 answers
111k views

How to add data dynamically to mat-table dataSource?

I have data streaming from backend and i see it printing in console now i am trying to push event to dataSource its throwing error dataSource is not defined. Can someone help how to dynamically add ...
hussain's user avatar
  • 6,951

15 30 50 per page
1
2 3 4 5
37