本文整理匯總了TypeScript中@cloudinary/angular-5.x.Cloudinary類的典型用法代碼示例。如果您正苦於以下問題:TypeScript x.Cloudinary類的具體用法?TypeScript x.Cloudinary怎麽用?TypeScript x.Cloudinary使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了x.Cloudinary類的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);
}
}
}
示例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));
}