@angular/router#ActivatedRoute TypeScript Examples

The following examples show how to use @angular/router#ActivatedRoute. 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 vote down vote up
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 vote down vote up
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 vote down vote up
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 vote down vote up
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: app.component.ts    From xBull-Wallet with GNU Affero General Public License v3.0 6 votes vote down vote up
constructor(
    @Inject(ENV)
    private readonly env: typeof environment,
    private readonly settingsService: SettingsService,
    private readonly settingsQuery: SettingsQuery,
    private readonly walletsAccountsService: WalletsAccountsService,
    private readonly walletsAccountsQuery: WalletsAccountsQuery,
    private readonly walletsOperationsQuery: WalletsOperationsQuery,
    private readonly alertsLabelsService: AlertsLabelsService,
    private readonly horizonApisQuery: HorizonApisQuery,
    private readonly route: ActivatedRoute,
    @Inject(DOCUMENT)
    private readonly document: Document,
    private readonly renderer2: Renderer2,
    private readonly globalsService: GlobalsService,
    private readonly ngZone: NgZone,
    private readonly translateService: TranslateService,
  ) { }
Example #6
Source File: app.component.ts    From rubic-app with GNU General Public License v3.0 6 votes vote down vote up
constructor(
    @Inject(DOCUMENT) private document: Document,
    private readonly translateService: TranslateService,
    private readonly cookieService: CookieService,
    private readonly iframeService: IframeService,
    private readonly gtmService: GoogleTagManagerService,
    private readonly healthCheckService: HealthcheckService,
    private readonly queryParamsService: QueryParamsService,
    private readonly activatedRoute: ActivatedRoute,
    private readonly errorService: ErrorsService
  ) {
    this.printTimestamp();
    this.initQueryParamsSubscription();
    this.setupLanguage();
    this.checkHealth();
  }
Example #7
Source File: login.component.ts    From ng-devui-admin with MIT License 6 votes vote down vote up
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 vote down vote up
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: pages-list.component.ts    From FireAdmin with MIT License 6 votes vote down vote up
constructor(
    private pages: PagesService,
    private alert: AlertService,
    private i18n: I18nService,
    private route: ActivatedRoute,
    public navigation: NavigationService,
    public currentUser: CurrentUserService,
    private settings: SettingsService
  ) { }
Example #10
Source File: login.component.ts    From master-frontend-lemoncode with MIT License 6 votes vote down vote up
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 vote down vote up
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: spotify-auth.component.ts    From ng-spotify-importer with GNU General Public License v3.0 6 votes vote down vote up
constructor(private activatedRoute: ActivatedRoute, private http: HttpClient, private spotifyService: SpotifyService) {
    if (!sessionStorage.codeVerifier) {
      sessionStorage.codeVerifier = this.spotifyService.generateCodeVerifier();
    }

    this.codeVerifier = sessionStorage.codeVerifier;
    this.codeChallenge = this.spotifyService.generateCodeChallenge(this.codeVerifier);
    this.authUrl = this.generateAuthUrl();
  }
Example #13
Source File: recipelist.component.spec.ts    From TheHungryRecipesApp with GNU General Public License v3.0 6 votes vote down vote up
describe('RecipelistComponent', () => {
  let component: RecipelistComponent;
  let fixture: ComponentFixture<RecipelistComponent>;

  beforeEach(async(() => {
    TestBed.configureTestingModule({
      declarations: [ RecipelistComponent ],
      imports: [ HttpClientTestingModule ],
      providers: [
        {
          provide: ActivatedRoute,
          useValue: {
            snapshot: {
              paramMap: {
                get: () => 'NAME'
              }
            }
          },
        },
      ]
    })
    .compileComponents();
  }));

  beforeEach(() => {
    fixture = TestBed.createComponent(RecipelistComponent);
    component = fixture.componentInstance;
    fixture.detectChanges();
  });

  it('should create', () => {
    expect(component).toBeTruthy();
  });
});
Example #14
Source File: create-dialog.component.ts    From leapp with Mozilla Public License 2.0 6 votes vote down vote up
/* Setup the first account for the application */
  constructor(
    public optionsService: OptionsService,
    public appService: AppService,
    private router: Router,
    private activatedRoute: ActivatedRoute,
    private bsModalService: BsModalService,
    public leappCoreService: AppProviderService,
    private windowService: WindowService,
    private messageToasterService: MessageToasterService
  ) {
    this.behaviouralSubjectService = leappCoreService.behaviouralSubjectService;
    this.awsIamRoleFederatedService = leappCoreService.awsIamRoleFederatedService;
    this.awsIamUserService = leappCoreService.awsIamUserService;
    this.awsIamRoleChainedService = leappCoreService.awsIamRoleChainedService;
    this.azureService = leappCoreService.azureService;
    this.loggingService = leappCoreService.logService;
  }
Example #15
Source File: bom-grouped-licenses.component.ts    From barista with Apache License 2.0 6 votes vote down vote up
constructor(
    private projectApiService: ProjectApiService,
    private route: ActivatedRoute,
    public dialog: MatDialog,
    private bomGlobalSearchFilterMessage: BomGlobalFilterMessageService,
    private messageService: BomLicenseExceptionOperationMessageService,
  ) {
    this.bomGlobalSearchFilterMessage
      .get()
      .pipe(untilDestroyed(this))
      .subscribe((data: MessageServiceBasePayload<string>) => {
        this.bomGlobalSearchFilter = data.payload;
        this.datatable.refresh();
      });
    this.messageService
      .get()
      .pipe(untilDestroyed(this))
      .subscribe(() => {
        this.datatable.refresh();
      });
  }
Example #16
Source File: breadcrumb.component.ts    From thorchain-explorer-singlechain with MIT License 6 votes vote down vote up
buildBreadCrumb(
    route: ActivatedRoute,
    url: string = '',
    breadcrumbs: Array<Breadcrumb> = []
  ): Array<Breadcrumb> {
    let label = route.routeConfig ? route.routeConfig?.data?.breadcrumb : null;
    let path = route.routeConfig ? route.routeConfig.path : '';

    const lastRoutePart = path.split('/').pop();
    const isDynamicRoute = lastRoutePart.startsWith(':');
    if (isDynamicRoute && !!route.snapshot) {
      const paramName = lastRoutePart.split(':')[1];
      path = path.replace(lastRoutePart, route.snapshot.params[paramName]);
      label = route.snapshot.params[paramName];
      if (label.length > 10) {
        label = label.substring(0, 8) + '...';
      }
    }

    const nextUrl = `${url}${path}/`;

    const breadcrumb = {
      label,
      url: nextUrl,
    };

    let newBreadcrumbs = breadcrumbs;
    if (breadcrumb.label) {
      newBreadcrumbs = [...breadcrumbs, breadcrumb];
    }

    if (route.firstChild) {
      return this.buildBreadCrumb(route.firstChild, nextUrl, newBreadcrumbs);
    }
    return newBreadcrumbs;
  }
Example #17
Source File: app-details.component.ts    From scion-microfrontend-platform with Eclipse Public License 2.0 6 votes vote down vote up
constructor(private _shellService: ShellService,
              private _route: ActivatedRoute,
              private _router: Router,
              private _manifestService: DevToolsManifestService,
              private _cd: ChangeDetectorRef) {
    this.application$ = this.observeApplication$();
    this.capabilities$ = this.observeCapabilities$();
    this.intentions$ = this.observeIntentions$();

    this.installTitleProvider();
    this.installTabActivator();
  }
Example #18
Source File: emote.component.ts    From App with MIT License 6 votes vote down vote up
constructor(
		@Inject(DOCUMENT) private document: Document,
		private metaService: Meta,
		private restService: RestService,
		private route: ActivatedRoute,
		private router: Router,
		private cdr: ChangeDetectorRef,
		private dialog: MatDialog,
		private appService: AppService,
		private emoteListService: EmoteListService,
		private dataService: DataService,
		public themingService: ThemingService,
		public clientService: ClientService
	) { }
Example #19
Source File: packages.component.ts    From SideQuest with MIT License 6 votes vote down vote up
constructor(
        public adbService: AdbClientService,
        public appService: AppService,
        public spinnerService: LoadingSpinnerService,
        public statusService: StatusBarService,
        private repoService: RepoService,
        router: Router,
        route: ActivatedRoute
    ) {
        appService.webService.isWebviewOpen = false;
        appService.resetTop();
        appService.isPackagesOpen = true;
        this.appService.setTitle('Installed Apps');
        this.sub = router.events.subscribe(val => {
            if (val instanceof NavigationEnd) {
                this.routerPackage = route.snapshot.paramMap.get('packageName');
            }
        });
        this.show_all = !!localStorage.getItem('packages_show_all');
    }
Example #20
Source File: car-edit-form.component.ts    From ReCapProject-Frontend with MIT License 6 votes vote down vote up
constructor(
    private formBuilder: FormBuilder,
    private toastrService: ToastrService,
    private carService: CarService,
    private brandService: BrandService,
    private colorService: ColorService,
    private carImageService: CarImageService,
    private activatedRoute: ActivatedRoute,
    private router: Router
  ) {}
Example #21
Source File: login.component.ts    From budget-angular with GNU General Public License v3.0 6 votes vote down vote up
constructor(
    private authService: AuthService,
    private oauthService: OAuthService,
    private formBuilder: FormBuilder,
    private snackBar: MatSnackBar,
    private dialog: MatDialog,
    private route: ActivatedRoute,
    private router: Router
  ) {}
Example #22
Source File: app.component.ts    From blockcore-explorer with MIT License 6 votes vote down vote up
constructor(
    private api: ApiService,
    private setup: SetupService,
    private theme: ThemeService,
    private router: Router,
    private renderer: Renderer2,
    private activatedRoute: ActivatedRoute) {

    this.theme.init(renderer);
  }
Example #23
Source File: analysis.component.ts    From one-platform with MIT License 5 votes vote down vote up
constructor(
    private router: ActivatedRoute,
    private dashboardService: DashboardService,
    private titleCasePipe: TitleCasePipe,
    @Inject(LOCALE_ID) private locale: string
  ) {}
Example #24
Source File: service-filter.page.ts    From Uber-ServeMe-System with MIT License 5 votes vote down vote up
constructor(
    public modalCtrl: ModalController,
    public router: Router,
    public firestore: AngularFirestore,
    public activatedRoute: ActivatedRoute,
    public navParams: NavParams,
  ) { 
  }
Example #25
Source File: clientsCreate.component.ts    From Smersh with MIT License 5 votes vote down vote up
constructor(
    protected service: ClientsService,
    protected router: Router,
    protected route: ActivatedRoute,
    protected snackBar: MatSnackBar
  ) {
    super(service, router, route, snackBar);
  }
Example #26
Source File: connect-no-wallet.component.ts    From xBull-Wallet with GNU Affero General Public License v3.0 5 votes vote down vote up
constructor(
    private readonly router: Router,
    private readonly route: ActivatedRoute,
  ) { }
Example #27
Source File: faq.component.ts    From rubic-app with GNU General Public License v3.0 5 votes vote down vote up
constructor(
    private readonly translateService: TranslateService,
    private readonly route: ActivatedRoute,
    private readonly element: ElementRef,
    @Self() private readonly destroy$: TuiDestroyService
  ) {
    this.fetchQuestions();
  }
Example #28
Source File: product-detail.component.ts    From Angular-ActionStreams with MIT License 5 votes vote down vote up
constructor(private route: ActivatedRoute,
              private productService: ProductService) { }
Example #29
Source File: product-detail.component.ts    From Angular-HigherOrderMapping with MIT License 5 votes vote down vote up
constructor(private route: ActivatedRoute,
    private productService: ProductService) { }