-
Notifications
You must be signed in to change notification settings - Fork 1
/
src_app_custom-elements_announcement-bar_announcement-bar_module_ts.b72ac8f808c1cd8b.js
2 lines (2 loc) · 1.86 KB
/
src_app_custom-elements_announcement-bar_announcement-bar_module_ts.b72ac8f808c1cd8b.js
1
2
"use strict";(self.webpackChunkangular_cn=self.webpackChunkangular_cn||[]).push([["src_app_custom-elements_announcement-bar_announcement-bar_module_ts"],{6042:(A,s,o)=>{o.r(s),o.d(s,{AnnouncementBarModule:()=>v});var m=o(4364),u=o(3882),l=o(4466),i=o(4864),d=o(9005),g=o(8485),n=o(2316),p=o(4541);function f(t,a){if(1&t&&(n.TgZ(0,"div",1),n.TgZ(1,"div",2),n._UZ(2,"img",3),n._UZ(3,"p",4),n.TgZ(4,"a",5),n._uU(5,"Learn More"),n.qZA(),n.qZA(),n.qZA()),2&t){const e=n.oxw();n.xp6(2),n.Q6J("src",e.announcement.imageUrl,n.LSH),n.xp6(1),n.Q6J("innerHTML",e.announcement.message,n.oJD),n.xp6(1),n.Q6J("href",e.announcement.linkUrl,n.LSH)}}const c=g.bL+"announcements.json";let h=(()=>{class t{constructor(e,r){this.http=e,this.logger=r}ngOnInit(){this.http.get(c).pipe((0,i.K)(e=>(this.logger.error(new Error(`${c} request failed: ${e.message}`)),[])),(0,d.U)(e=>this.findCurrentAnnouncement(e)),(0,i.K)(e=>(this.logger.error(new Error(`${c} contains invalid data: ${e.message}`)),[]))).subscribe(e=>this.announcement=e)}findCurrentAnnouncement(e){return e.filter(r=>new Date(r.startDate).valueOf()<Date.now()).filter(r=>new Date(r.endDate).valueOf()>Date.now())[0]}}return t.\u0275fac=function(e){return new(e||t)(n.Y36(u.eN),n.Y36(p.Y))},t.\u0275cmp=n.Xpm({type:t,selectors:[["aio-announcement-bar"]],decls:1,vars:1,consts:[["class","homepage-container",4,"ngIf"],[1,"homepage-container"],[1,"announcement-bar"],["alt","",3,"src"],[3,"innerHTML"],[1,"button",3,"href"]],template:function(e,r){1&e&&n.YNc(0,f,6,3,"div",0),2&e&&n.Q6J("ngIf",r.announcement)},directives:[m.O5],encapsulation:2}),t})(),v=(()=>{class t{constructor(){this.customElementComponent=h}}return t.\u0275fac=function(e){return new(e||t)},t.\u0275mod=n.oAB({type:t}),t.\u0275inj=n.cJS({imports:[[m.ez,l.m,u.JF]]}),t})()}}]);
//# sourceMappingURL=src_app_custom-elements_announcement-bar_announcement-bar_module_ts.b72ac8f808c1cd8b.js.map