Questions tagged angular-ui-router

Explore the latest questions and answers asked by our top developers.

Correct way to scroll to dynamic angular page

I am searching for the correct way to correct to scroll in a page that will load dynamic information. These informations are asynchronous so to avoid my user seeing the whole page constructing itself I have a boolean flag like so : <div *ngIf="loaded"> … </div> My problem is that I want to scroll to […]

By Kevin Heirich
Published
Categorized as angular, angular-ui-router, html Tagged , ,

How to export standalone html/css with javascript from angular project?

I have an angular project with html’s/CSS/component(.ts files)/service(.ts files). service methods are reading data from .json files in the assets folder(not calling backend). I am doing a prod build which will generate html’s/CSS/javascript files in dist folder. The problem is generated index.html file is not rendering, displaying blank screen in browser without server(application server). My […]

Refactor Angular `LoadedRouterConfig` import which is not available anymore

I have an Angular application that I’m upgrading to version 8 and running into an issue of LoadedRouterConfig not being exposed publicly anymore. I can’t find any Angular documentation on this, so I’m not sure how to re-write the code that uses it. Seems like it’s creating dynamic routes on the fly? import {LoadedRouterConfig} from […]

By user1142130
Published
Categorized as angular, angular-ui-router, javascript Tagged , ,

Delay canActivate call when page refreshes in order to wait for the data to load

When I reload my page, it always goes to blank page instead of the same page. The reason behind this is canActivate method which is cheking for user’s permission gets invoked as soon as user refreshes the page and it is not able to get user data immediately. User data comes after some seconds. Is […]

By Radiant
Published
Categorized as angular, angular-ui-router, canactivate, rxjs Tagged , , ,

Why would Angular create 2 separate variable spaces when resetting the url parameters?

I’m encountering a strange situation in my Angular 11 application and I’m wondering if anyone can explain to me what’s going on. Here’s what’s happening: On my page, I have a filter component that contains several drop downs like this: <mtx-lookup fxFlex="300px" label="Company Filter" [ngModel]="filter.companyId" [options]=companyOptions$ (ngModelChange)="notifyFilterChange($event, ‘company’)" [loading] =!companyOptionsSubscription?.closed > The mtx-lookup consists of […]

Angular: How to use a Component as route entry and in another component’s template

I’m facing the following issue: We have different components, which are loaded in an iframe inside our application. Now I want to use one of these components in an embedded way via selector tag, too. So given is a ComponentA: @Component( { selector: ‘a’, templateUrl: ‘./a.component.html’, ….. in ModuleA: const routes: Routes = [ { […]

what is the best approach for Authorization in angular 8/9/10/11/12? [closed]

I am working on a large application in Angular 9. I want to protect each and every route that no one can access my route just typing the url in the url bar. I know that I can make a auth guard and can implement canActivate method. But I want to know, is this fine […]

Angular routing not working in production (aruba hosting)

i know this may be a duplicate but i didn’t found any solution in other questions. I’ve some troubles with angular routing in production. I tried many solutions, it only works with {useHash: true}. My last attempt was to set .htaccess in project’s root and try different configurations. My suspect is that aruba server is […]

Why is Angular calling `registerOnChange` after `ngOnDestroy` on custom ControlValueAccessor component?

After creating a custom form element, I noticed that when I navigated away from a route that hosted that custom form element, Angular would call the form element’s ngOnDestroy method and then it would call the form element’s registerOnChange and registerOnTouched methods. I’m not sure why it would call these two methods at this point, […]

Div inside router-outlet doesn’t work properly

I have a default layout which looks like this: <div fxLayout="row"> <div class="navbar" fxLayout="column"> <a routerLink="/home">Home</a> </div> <div class="mainDiv" fxFlex> <router-outlet></router-outlet> </div> </div> I have another component called TableComponent which is dislayed inside the mainDiv: <div class="mat-elevation-z8"> <table mat-table [dataSource]="dataSource"> <!– Position Column –> <ng-container matColumnDef="position"> <th mat-header-cell *matHeaderCellDef [attr.rowspan]="2">No.</th> <td mat-cell *matCellDef="let element">1</td> </ng-container> […]

1 54

Still Have Questions?


Our dedicated development team is here for you!

We can help you find answers to your question for as low as 5$.

Contact Us
faq