当前位置: 首页>>代码示例>>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;未经允许,请勿转载。