本文整理汇总了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);
}
}
}
开发者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类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论