當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript Location.prepareExternalUrl方法代碼示例

本文整理匯總了TypeScript中@angular/common.Location.prepareExternalUrl方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript Location.prepareExternalUrl方法的具體用法?TypeScript Location.prepareExternalUrl怎麽用?TypeScript Location.prepareExternalUrl使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在@angular/common.Location的用法示例。


在下文中一共展示了Location.prepareExternalUrl方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: String

      (prev, route: AngularRoute & {server?: boolean}) => {
        const prepared = location.prepareExternalUrl(parent.concat(route.path || []).join('/'));

        const path = prepared.replace(/(^\.|\*\*?)/g, String()).split(/\//g).filter(v => v);

        return prev.concat({path, server: route.server}, flatten(path, route.children || []));
      },
開發者ID:sonukapoor,項目名稱:angular-ssr,代碼行數:7,代碼來源:extract.ts

示例2: getDetails

  getDetails(cid, ckid, member_id): Observable<any> {
    const fhid = this.authService.getFirehallId();
    const href = this.location.prepareExternalUrl('../angular-services/callout-details-service.php');
    const requestUrl = `${href}/details?fhid=${fhid}&cid=${cid}&ckid=${ckid}&member_id=${member_id}`;

    // console.log('About to call details for: ' + requestUrl);
    return this.http.get<CalloutDetailsItem>(requestUrl);
  }
開發者ID:softcoder,項目名稱:riprunner,代碼行數:8,代碼來源:callout-details.service.ts

示例3: isMaps

 public isMaps(path){
     var titlee = this.location.prepareExternalUrl(this.location.path());
     titlee = titlee.slice( 1 );
     if(path === titlee){
         return true;
     }
     else {
         return false;
     }
 }
開發者ID:W3SS,項目名稱:light-bootstrap-dashboard-angular,代碼行數:10,代碼來源:app.component.ts

示例4: updateResponse

  updateResponse(cid, ckid, member_id, responder_id, status_id) {
    // debugger;

    const fhid = this.authService.getFirehallId();
    const href = this.location.prepareExternalUrl('../cr');
    let requestUrl = `${href}/fhid=${fhid}&cid=${cid}&ckid=${ckid}&uid=${responder_id}&status=${status_id}`;
    if (member_id !== null) {
      requestUrl += `&member_id=${member_id}`;
    }
    return this.http.get(requestUrl, { responseType: 'text' });
  }
開發者ID:softcoder,項目名稱:riprunner,代碼行數:11,代碼來源:callout-details.service.ts

示例5: getItemUrl

 getItemUrl(item: MenuItem): string {
     if(item.url) {
         if(Array.isArray(item.url))
             return this.location.prepareExternalUrl(this.router.generate(item.url).toLinkUrl());
         else
             return item.url;
     }
     else {
         return '#';
     }
 }
開發者ID:furkanzumrut,項目名稱:primeng,代碼行數:11,代碼來源:tabmenu.ts

示例6: getTitle

 getTitle(){
     var titlee = this.location.prepareExternalUrl(this.location.path());
     if(titlee.charAt(0) === '#'){
         titlee = titlee.slice( 2 );
     }
     for(var item = 0; item < this.listTitles.length; item++){
         if(this.listTitles[item].path === titlee){
             return this.listTitles[item].title;
         }
     }
     return 'Cluster';
 }
開發者ID:Abiy,項目名稱:distGatling,代碼行數:12,代碼來源:navbar.component.ts

示例7: editUserAccount

 editUserAccount(password1: string, password2: string, user: UserAccount): Promise<any> {
   const fhid = this.authService.getFirehallId();
   const href = this.location.prepareExternalUrl('../angular-services/user-accounts-service.php');
   const requestUrl = `${href}/edit_user?password1=${password1}&password2=${password2}`;
   return this.http.post(requestUrl, user).toPromise()
   .then(response => {
       //debugger;
       return response;
   })
   .catch((err) => {
     //debugger;
     return this.handleErrorPromise(err);
   });
 }
開發者ID:softcoder,項目名稱:riprunner,代碼行數:14,代碼來源:user-accounts.service.ts

示例8: getTitle

    getTitle(){
      var titlee = this.location.prepareExternalUrl(this.location.path());
      if(titlee.charAt(0) === '#'){
          titlee = titlee.slice( 2 );
      }
      titlee = titlee.split('/').pop();

      for(var item = 0; item < this.listTitles.length; item++){
          if(this.listTitles[item].path === titlee){
              return this.listTitles[item].title;
          }
      }
      return 'Dashboard';
    }
開發者ID:Kerrex,項目名稱:TrainingCenter_Frontend,代碼行數:14,代碼來源:navbar.component.ts

示例9: deleteUserAccount

 deleteUserAccount(user_id: number): Promise<any> {
   // debugger;
   const fhid = this.authService.getFirehallId();
   const href = this.location.prepareExternalUrl('../angular-services/user-accounts-service.php');
   const requestUrl = `${href}/delete_user?fhid=${fhid}&user_id=${user_id}`;
   return this.http.post(requestUrl, null).toPromise()
   .then(response => {
       // debugger;
       return response;
   })
   .catch((err) => {
     debugger;
     return this.handleErrorPromise(err);
   });
 }
開發者ID:softcoder,項目名稱:riprunner,代碼行數:15,代碼來源:user-accounts.service.ts

示例10: send

 send(msgContext: MessageContext): Promise<any> {
   debugger;
   const fhid = this.authService.getFirehallId();
   const href = this.location.prepareExternalUrl('../angular-services/send-message-service.php');
   const requestUrl = `${href}/send?fhid=${fhid}`;
   return this.http.post(requestUrl, msgContext).toPromise()
   .then(response => {
       debugger;
       return response;
   })
   .catch((err) => {
     debugger;
     return this.handleErrorPromise(err);
   });
 }
開發者ID:softcoder,項目名稱:riprunner,代碼行數:15,代碼來源:send-message.service.ts

示例11: setLocale

    setLocale(code: string) {
        let url = this.ngLocation.prepareExternalUrl('/');

        // The last part of the base path will be the locale
        // Replace it with the selected locale
        url = url.replace(/\/[a-z]{2}-[A-Z]{2}\/$/, `/${code}`);

        // Finally tack the path of the current page back onto the URL
        // which is more friendly than forcing them back to the splash page.
        url += this.ngLocation.path();

        // Set a 10-year locale cookie to maintain compatibility
        // with the AngularJS client.
        // Cookie takes the form aa_bb instead of aa-BB
        const cookie = code.replace(/-/, '_').toLowerCase();
        this.cookieService.put('eg_locale',
            cookie, {path : '/', secure: true, expires: '+10y'});

        window.location.href = url;
    }
開發者ID:jamesrf,項目名稱:Evergreen,代碼行數:20,代碼來源:locale.service.ts

示例12: prepareExternalUrl

 prepareExternalUrl(url: string): string {
   return this.location.prepareExternalUrl(url);
 }
開發者ID:catrielmuller,項目名稱:angulartics2,代碼行數:3,代碼來源:angular-router.ts

示例13: currentLocaleCode

 // Extract the local from the URL.
 // It's the last component of the base path.
 // Note we don't extract it from the cookie since using cookies
 // to store the locale will not be necessary when AngularJS
 // is deprecated.
 currentLocaleCode(): string {
     const base = this.ngLocation.prepareExternalUrl('/');
     const code = base.match(/\/([a-z]{2}-[A-Z]{2})\/$/);
     return code ? code[1] : '';
 }
開發者ID:jamesrf,項目名稱:Evergreen,代碼行數:10,代碼來源:locale.service.ts

示例14: _updateLink

 // because auxiliary links take existing primary and auxiliary routes into account,
 // we need to update the link whenever params or other routes change.
 private _updateLink(): void {
   this._navigationInstruction = this._router.generate(this._routeParams);
   var navigationHref = this._navigationInstruction.toLinkUrl();
   this.visibleHref = this._location.prepareExternalUrl(navigationHref);
 }
開發者ID:Coco-wan,項目名稱:angular,代碼行數:7,代碼來源:router_link.ts

示例15:

 router.subscribe((value: any) => {
     console.log('this is working');
   if (!this.settings.developerMode) {
     var url = location.path();
     if (this.settings.pageTracking.autoTrackVirtualPages && !this.matchesExcludedRouteChild(url)) {
       this.pageTrack.next({
         path: this.settings.pageTracking.basePath.length ? this.settings.pageTracking.basePath + url : location.prepareExternalUrl(url),
         location: location
       });
     }
   }
 })
開發者ID:jbcorry,項目名稱:angular2-with-GA,代碼行數:12,代碼來源:main.ts


注:本文中的@angular/common.Location.prepareExternalUrl方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。