@angular/router#Router TypeScript Examples
The following examples show how to use
@angular/router#Router.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: base.component.ts From 1hop with MIT License | 6 votes |
constructor(
private location: Location,
public navigationService: NavigationService,
private route: ActivatedRoute,
private router: Router,
private configurationService: ConfigurationService,
public themeService: ThemeService,
public web3Service: Web3Service,
private modalService: BsModalService,
protected connectService: ConnectService,
public transactionService: TransactionService,
public tokenService: TokenService
) {
}
Example #2
Source File: base.component.ts From 1x.ag with MIT License | 6 votes |
constructor(
private location: Location,
public navigationService: NavigationService,
private route: ActivatedRoute,
private router: Router,
private configurationService: ConfigurationService,
public themeService: ThemeService,
public web3Service: Web3Service,
public tokenService: TokenService,
private modalService: BsModalService,
protected connectService: ConnectService,
public transactionService: TransactionService
) {
}
Example #3
Source File: service-map.page.ts From Uber-ServeMe-System with MIT License | 6 votes |
constructor(
public toastCtrl: ToastController,
private platform: Platform,
private loadingCtrl: LoadingController,
// private ngZone: NgZone,
public route: Router,
public activatedRoute: ActivatedRoute,
public nav: NavController,
private elementRef: ElementRef,
private renderer: Renderer2,
public modalCtrl: ModalController,
public firestore: AngularFirestore,
public navCtrl: NavController,
// private dataService: DataService,
) {
// console.log('declared var:', google)
// this.activateRoute.queryParams.subscribe((data: any) => {
// console.log("data.service:", data.service)
// this.service = data.service
// console.log("service1:", this.service)
// })
}
Example #4
Source File: add-vulns-to-host-external.component.ts From Smersh with MIT License | 6 votes |
constructor(
private vulnsService: VulnsService,
private mediaObjectsService: MediaObjectsService,
private hostsService: HostsService,
private hostVulnsService: HostVulnsService,
private activatedRoute: ActivatedRoute,
private impactService: ImpactsService,
private _snackBar: MatSnackBar,
private missionServices: MissionsService,
private router: Router
) {}
Example #5
Source File: confirm-phrase-password.component.ts From xBull-Wallet with GNU Affero General Public License v3.0 | 6 votes |
constructor(
private readonly generateAccountQuery: GenerateAccountQuery,
private readonly cryptoService: CryptoService,
private readonly walletsService: WalletsService,
private readonly walletsQuery: WalletsQuery,
private readonly router: Router,
@Inject(ENV) private readonly env: typeof environment,
private mnemonicPhraseService: MnemonicPhraseService,
private readonly nzMessageService: NzMessageService,
private readonly translateService: TranslateService,
) { }
Example #6
Source File: user-profile.component.ts From rubic-app with GNU General Public License v3.0 | 6 votes |
constructor(
private readonly headerStore: HeaderStore,
private readonly router: Router,
private readonly cdr: ChangeDetectorRef,
private readonly authService: AuthService,
private readonly walletConnectorService: WalletConnectorService,
private translateService: TranslateService,
@Inject(TuiDialogService) private readonly dialogService: TuiDialogService,
@Inject(Injector) private injector: Injector,
@Inject(WINDOW) private readonly window: Window,
@Self() private readonly destroy$: TuiDestroyService
) {
this.isMobile$ = this.headerStore.getMobileDisplayStatus();
this.isConfirmModalOpened$ = this.headerStore.getConfirmModalOpeningStatus();
this.router.events.subscribe(event => {
if (event instanceof NavigationStart) {
this.headerStore.setMobileMenuOpeningStatus(false);
this.headerStore.setConfirmModalOpeningStatus(false);
}
});
this.currentUser$ = this.authService.getCurrentUser();
}
Example #7
Source File: login.component.ts From ng-devui-admin with MIT License | 6 votes |
constructor(
private router: Router,
private route: ActivatedRoute,
private authService: AuthService,
private translate: TranslateService,
private i18n: I18nService,
private personalizeService: PersonalizeService
) {
this.language = this.translate.currentLang;
}
Example #8
Source File: manager.component.ts From RcloneNg with MIT License | 6 votes |
constructor(
private toastrService: NbToastrService,
private clipboard: ClipboardService,
private resp: ResponsiveSizeInfoRx,
public modal: Modal,
private router: Router,
private route: ActivatedRoute,
private sidebarService: NbSidebarService,
private tasksQueueService: TasksQueueService
) {}
Example #9
Source File: app.component.ts From ng-conf-2020-workshop with MIT License | 6 votes |
constructor(private router: Router) {
for (const route of routes) {
if (route.path && route.data && route.path.indexOf('*') === -1) {
this.topNavLinks.push({
name: route.data.text,
path: '/' + route.path
});
}
}
}
Example #10
Source File: login.component.ts From master-frontend-lemoncode with MIT License | 6 votes |
constructor(private router: Router, private route: ActivatedRoute) {
// Si esta fuera la url: https://lemoncode.net/master-frontend/login?type="student"
// En forma de observable
this.route.queryParams.subscribe(
queryParams => this.loginType = queryParams['type']
);
// Como snapshot
this.loginType = this.route.snapshot.queryParams['type'];
}
Example #11
Source File: admin-product.component.ts From mslearn-live-azure-fundamentals with MIT License | 6 votes |
constructor(dataClient: DataClient, formatter: FormattingHelpers, route: ActivatedRoute, private formBuilder: FormBuilder, private router: Router) {
this.formatter = formatter;
this.data = dataClient;
this.id = route.snapshot.paramMap.get("productId");
this.isCreateNewMode = this.id == "$new";
this.productForm = this.formBuilder.group({
name: ['', Validators.required],
description: ['', Validators.required],
category: ['', Validators.required],
price: ['', Validators.required],
stockUnits: ['', Validators.required],
thumbnailImage: ['', Validators.required]
});
this.hasLoaded = true;
}
Example #12
Source File: app.component.ts From mylog14 with GNU General Public License v3.0 | 6 votes |
constructor(
private readonly dataStore: DataStoreService,
private readonly platform: Platform,
private readonly router: Router,
private readonly language: LanguageService
) {
this.setStatusBarStyle().subscribe();
this.dataInitialized()
.pipe(
switchMap(() => this.language.init()),
switchMap(() => this.dataStore.userData$.pipe(take(1))),
switchMap(userData => {
return (userData.recordPreset) ? of(userData) : this.dataStore.updateUserData({ recordPreset: RecordPreset.COMMON_COLD });
})
)
.subscribe(userData => {
if (userData.newUser) {
this.router.navigate(['/onboarding']);
}
SplashScreen.hide();
});
this.dataStore.initializeStore().subscribe();
}
Example #13
Source File: home.component.ts From msfs-community-downloader with GNU Affero General Public License v3.0 | 6 votes |
constructor(
private app: ApplicationRef,
private settingsService: SettingsService,
private router: Router,
private domainService: DomainService) {
this.errorSub = this.domainService.errorSubject.subscribe(err => {
this.displayError(err);
});
}
Example #14
Source File: app.component.ts From TheHungryRecipesApp with GNU General Public License v3.0 | 6 votes |
constructor(
router: Router,
private appService: AppService
) {
this.loading = false;
router.events.subscribe(
(event: RouterEvent):void => {
if ( event instanceof NavigationStart ) {
this.loading = true;
} else if ( event instanceof NavigationEnd ) {
this.loading = false;
}
}
);
}
Example #15
Source File: app.component.ts From leapp with Mozilla Public License 2.0 | 6 votes |
/* Main app file: launches the Angular framework inside Electron app */
constructor(
public appProviderService: AppProviderService,
public mfaCodePrompter: AppMfaCodePromptService,
public awsAuthenticationService: AppAwsAuthenticationService,
public verificationWindowService: AppVerificationWindowService,
public appService: AppService,
private router: Router,
private optionsService: OptionsService,
private updaterService: UpdaterService,
private windowService: WindowService,
private electronService: AppNativeService
) {
appProviderService.mfaCodePrompter = mfaCodePrompter;
appProviderService.awsAuthenticationService = awsAuthenticationService;
appProviderService.verificationWindowService = verificationWindowService;
appProviderService.windowService = windowService;
this.fileService = appProviderService.fileService;
this.awsCoreService = appProviderService.awsCoreService;
this.loggingService = appProviderService.logService;
this.timerService = appProviderService.timerService;
this.sessionServiceFactory = appProviderService.sessionFactory;
this.behaviouralSubjectService = appProviderService.behaviouralSubjectService;
this.retroCompatibilityService = appProviderService.retroCompatibilityService;
this.rotationService = appProviderService.rotationService;
this.awsSsoIntegrationService = appProviderService.awsSsoIntegrationService;
this.awsSsoRoleService = appProviderService.awsSsoRoleService;
this.remoteProceduresServer = appProviderService.remoteProceduresServer;
this.setInitialColorSchema();
this.setColorSchemaChangeEventListener();
}
Example #16
Source File: bom-license-exceptions.component.ts From barista with Apache License 2.0 | 6 votes |
constructor(
private bomLicenseExceptionApiService: BomLicenseExceptionApiService,
private router: Router,
private route: ActivatedRoute,
public dialog: MatDialog,
private messageService: BomLicenseExceptionOperationMessageService,
private bomGlobalSearchFilterMessage: BomGlobalFilterMessageService,
private authService: AuthService,
) {
this.messageService
.get()
.pipe(untilDestroyed(this))
.subscribe(() => {
this.datatable.refresh();
});
this.bomGlobalSearchFilterMessage
.get()
.pipe(untilDestroyed(this))
.subscribe((data: MessageServiceBasePayload<string>) => {
this.bomGlobalSearchFilter = data.payload;
this.datatable.refresh();
});
}
Example #17
Source File: app.component.ts From Angular-Cookbook with MIT License | 6 votes |
constructor(private auth: AuthService, private router: Router) {
this.router.events.subscribe((event) => {
if (event instanceof NavigationStart) {
this.isLoadingRoute = true;
}
if (
event instanceof NavigationEnd ||
event instanceof NavigationError ||
event instanceof NavigationCancel
) {
this.isLoadingRoute = false;
}
});
}
Example #18
Source File: home.component.ts From one-platform with MIT License | 5 votes |
constructor(
private dashboardService: DashboardService,
private router: Router
) {}
Example #19
Source File: vendorhome-popover.component.ts From Uber-ServeMe-System with MIT License | 5 votes |
constructor(
public route: Router,
public popCtrl: PopoverController,
) { }
Example #20
Source File: app.component.ts From DocumentationWebPage with MIT License | 5 votes |
constructor(private router: Router){}
Example #21
Source File: app.component.ts From Smersh with MIT License | 5 votes |
constructor(
private http: HttpClient,
private router: Router,
private dialog: MatDialog,
private themeService: ThemeService
) {}