angular9

Angular 9 isssue with dynamic component load

Deadly 提交于 2021-02-11 16:56:56
问题 Dynamic components were loading absolutely fine in Angular 8. Once a component is loaded, Detach and Interest of components was also working fine. I am using ng-three-template. loadComponent(componentID: number, component: any) { this.viewContainerRef.detach(); if( this.componentFactory[componentID] == undefined ) { this.componentFactory[componentID] = this.componentFactoryResolver.resolveComponentFactory( component ); this.componentRef[componentID] = this.viewContainerRef.createComponent(

Angular 9 isssue with dynamic component load

大兔子大兔子 提交于 2021-02-11 16:55:07
问题 Dynamic components were loading absolutely fine in Angular 8. Once a component is loaded, Detach and Interest of components was also working fine. I am using ng-three-template. loadComponent(componentID: number, component: any) { this.viewContainerRef.detach(); if( this.componentFactory[componentID] == undefined ) { this.componentFactory[componentID] = this.componentFactoryResolver.resolveComponentFactory( component ); this.componentRef[componentID] = this.viewContainerRef.createComponent(

Angular: configure default QueryParamsHandling

半腔热情 提交于 2021-02-08 09:15:48
问题 I've built an angular 9 app, and added localization with @ngx-translate. I've configured my app so that it takes the lang query parameter and changes the locale accordingly. @Component({ selector: 'app-root', templateUrl: './app.component.html', styleUrls: ['./app.component.scss'] }) export class AppComponent implements OnInit, OnDestroy { constructor(private route: ActivatedRoute, private translateService: TranslateService) { this.translateService.setDefaultLang('en'); this.route

Get ViewChildren Template By Id

半城伤御伤魂 提交于 2021-02-08 08:19:27
问题 In my component I get a list of its markup templates by using ViewChildren: @ViewChildren(TemplateRef) private _templates: QueryList<TemplateRef<unknown>>; In Angular8 I was not able to filter them by an Id, so i needed to look for an internal property - which was somehow a bit hacky: let template = this._templates.find(t => (<any>t)._def.references[id]) : null; Now, with Angular 9, this doesn't work anymore. I checked the object and found a new "hack": this._templates.find(t => (<any>t).

Angular 9 Service as Obesrvable in library

不想你离开。 提交于 2021-01-29 19:56:24
问题 I am working on multiapplication setup, where inside workspace 2 or 3 applications will share library with common and shared components. Currently, I am adding notifications service. Added (at least for now) as part of library main module. As base I am using this example from stackblitz or this one When calling notification service from inside library (which is inside the same module as notification.component: this._notificationSvc.success('Hello World','This is a success !'); the service

Angular 10 universal | amcharts 4 : Why the server tries to load the chart?

我的梦境 提交于 2021-01-29 19:07:50
问题 I am used to Angular but I am just starting to use universal (for SEO). I want to use a map from amcharts 4, I have no problems using without Angular Universal. I know that it is a known issue but I do not understand why in my case the server tries to load the chart and create this error: ERROR Error: Uncaught (in promise): ReferenceError: addEventListener is not defined ReferenceError: addEventListener is not defined ... My code : constructor( @Inject(PLATFORM_ID) private platformId: Object

ERROR in The target entry-point “@nativescript/angular” has missing dependencies on running a Nativescript Angular 9 project

感情迁移 提交于 2021-01-29 16:42:42
问题 I am receiving an error for a working Nativescript Angular 9 project which we started 2 weeks back . The error is like this : ERROR in The target entry-point "@nativescript/angular" has missing dependencies: - @nativescript/core/ui/layouts/layout-base We are working on a sharing code base which we were able to run both web code and native code simultaneously without any issues till last day. Today when i tried running the project for web application, i am getting this error. On googling , got

Basic GET request failed Angular and Spring

蹲街弑〆低调 提交于 2021-01-29 15:30:38
问题 I am trying to make a simple request from angular to spring. I used bare bone spring web and spring security and simple angular(9) request. Let me share my Java and Angular code. Java Code @RestController @CrossOrigin(origins = "http://localhost:4200") public class Main { @RequestMapping("/hello") public Map<String,Object> home(){ Map<String, Object> model = new HashMap<String, Object>(); model.put("id", UUID.randomUUID().toString()); model.put("content", "Hello from Backend"); return model;

How can we set errors on form array control dynamically on initally page load

北城余情 提交于 2021-01-29 10:33:46
问题 In one of my requirements, I have form an array-like grid table contains rows and columns. once on Init i am doing a service call and get the columns and values and error messages. based on that i have created a form array for that columns and each columns have errormessage if errormessage exists need to set errors. I can able to set value for those columns but not able to set errors while pushing into form array i don't know how could I push error as well. stuck on this line. Qn? On

How to dynamically create/modify sitemap.xml file in angular 9 project structure at runtime?

浪尽此生 提交于 2021-01-29 08:50:29
问题 How to create dynamic sitemap.xml file in Angular 9 project structure ? I can get data using HTTP get request from node API but using this data how can I update local xml file from angular project at runtime ? In my case, angular project and node project are on different server(different domain). And It is possible to create xml file in node project but I am not able to access that file as xml file in angular project root . Can anyone please suggest me how to use node xml in angular project