本文整理汇总了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);
}
}
}
示例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));
}