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


TypeScript x.Cloudinary.url方法代碼示例

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


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

示例1: initializeFavicon

 /**
  * Hack for having Angular manipulate content in <head> section, which is not bootstrapped by it...
  */
 initializeFavicon() {
     // Change value of the meta tag
     const links = document.getElementsByTagName('link');
     const length = links.length;
     for (let i = 0; i < length; i++) {
         const link = links[i];
         const clHref = link.getAttribute('clHref');
         if (clHref) {
             const href = this.cloudinary.url(clHref, this.cloudinary.toCloudinaryAttributes(link.attributes));
             link.setAttribute('href', href);
         }
     }
 }
開發者ID:RTLcoil,項目名稱:cloudinary_angular,代碼行數:16,代碼來源:app.component.ts

示例2: getPhotos

    getPhotos(): Observable<Photo[]> {
        // instead of maintaining the list of images, we rely on the 'myphotoalbum' tag
        // and simply retrieve a list of all images with that tag.
        let url = this.cloudinary.url('myphotoalbum', {
            format: 'json',
            type: 'list',
            // cache bust (lists are cached by the CDN for 1 minute)
            // *************************************************************************
            // Note that this is practice is DISCOURAGED in production code and is here
            // for demonstration purposes only
            // *************************************************************************
            version: Math.ceil(new Date().getTime() / 1000)
        });

        return this.http.get(url).pipe(map((data: any) => data.resources));
    }
開發者ID:RTLcoil,項目名稱:cloudinary_angular,代碼行數:16,代碼來源:photo-album.service.ts


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