angular6

Issue after upgrading Angular 4 to angular 8

梦想与她 提交于 2020-01-22 01:24:31
问题 Currently I am using Angular 4 in my application with system.js. Now I am updating it to Angular 8. For that I follow below 2 links: upgrade angular 4 project to angular 6 https://www.talkingdotnet.com/upgrade-angular-4-app-angular-5-visual-studio-2017/ I did below changes : Updated all packages in package.json http to httpclient httpmodule to httpclientmodule http request (map.json) rxjs changes When I run application after all changes and I am getting below error: Uncaught SyntaxError:

Translate strings inside Angular Typescript code

自作多情 提交于 2020-01-21 19:41:10
问题 Is it possible to translate strings inside the source code of a component in Angular6. F. e. window.confirm("HELP me"); I haven't found anything besides the normal translation for the HTML files (Angular Docs i18n). Thank you in advance 回答1: You can use https://github.com/ngx-translate/i18n-polyfill until Angular i18n get built-in support for it, probably around version 9. The author is working on Angular i18n, so I think it is safe to trust his expectation that it will be close to the future

How many ways are there to increase the performance in angular? [closed]

独自空忆成欢 提交于 2020-01-21 10:14:07
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 14 days ago . I am an angular front end developer and I am new for testing the run time performance. For checking the performance I downloaded the google plugin, " Performance-Analyser ". And I got the performance time as below. For DOM processing itself, its taking 5.4 Secs. (For our

Angular httpClient interceptor error handling

痞子三分冷 提交于 2020-01-21 04:52:05
问题 after reading the documentation on angular about http client error handling, I still don't understand why I don't catch a 401 error from the server with the code below: export class interceptor implements HttpInterceptor { intercept(request: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> { console.log('this log is printed on the console!'); return next.handle(request).do(() => (err: any) => { console.log('this log isn't'); if (err instanceof HttpErrorResponse) { if (err

Calling Http.post does not trigger a post in angular 6

做~自己de王妃 提交于 2020-01-21 02:15:12
问题 I generated my entities components and services according to my model using this tool. Everything worked fine, but I ran into a problem when trying to log a user in my API (that is functional). The http.post() method is not triggered. I'm pretty new to angular and can't figure out what I am doing wrong. Any help would be great! Here's my login method from my UserService (the method is called properly, it's only the http.post() that's not working): /** * Log a user by its credentials. */ login

Angular 6 - Get current route and it's data

夙愿已清 提交于 2020-01-20 21:43:29
问题 How do you able to get current route you're in and get's it's data, children and it's parent? say if this is the route structure: const routes: Routes = [ {path: 'home', component: HomeComponent, data: {title: 'Home'}}, { path: 'about', component: AboutComponent, data: {title: 'About'}, children: [ { path: 'company', component: 'CompanyComponent', data: {title: 'Company'} }, { path: 'mission', component: 'MissionComponent', data: {title: 'Mission'} }, ... ] }, ... ] If I am currently in

Nested form array in angular

元气小坏坏 提交于 2020-01-17 01:19:54
问题 I am making angular application with reactive form, where i have made a nested form array which will get nested on button click. A clean working example https://stackblitz.com/edit/angular-thhczx , it has static inputs and hence on click over Add new template , it will add a another nested part and for Add new property , it will generate another property array.. So you had got the above working example concept right?? I would like to have the same json but not with add button and with

How to edit and update the dynamically added input values [closed]

余生颓废 提交于 2020-01-17 01:16:10
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 10 months ago . Scenario: Below is my json file called contacts : [ { "name": "Ailis Wyld", "addresses": [ { "addressType": "Business", "city": "Lansing", "postalCode": "48930" }, { "addressType": "Home", "city": "Young America", "postalCode": "55573" } ] }, { "name": "Aksel", "addresses": [ { "addressType": "Business", "city

How to always open PrimeNg's p-calendar on today's date

流过昼夜 提交于 2020-01-16 19:58:06
问题 ''I am using PrimeNg's calendar in my Angular Application. I am using multiple selectionMode and binding the calendar to an array of dates from the database. The calendar starts on the latest date in the range from the database but I want it to always start off with today's date and then the user can navigate backwards and forwards to see the previously selected dates from the database. I set the defaultDate but it doesn't make any difference. Please help. Thanks, my html: <p-calendar [

Make Module global available in Angular application

放肆的年华 提交于 2020-01-16 15:41:33
问题 I have the following Module which components I use on other modules: import { NgModule } from '@angular/core'; import { CommonModule } from '@angular/common'; import { ClickOutsideModule } from "ng-click-outside"; import { PopupComponent} from './popup.component'; @NgModule({ declarations: [ PopupComponent ], imports: [ CommonModule, ClickOutsideModule ], exports: [ PopupComponent ], providers: [] }) export class PopupModule {} And I have my AppModule: import { NgModule } from '@angular/core'