-
Notifications
You must be signed in to change notification settings - Fork 2
/
announcement-bar-announcement-bar-module-es2015.4d0dcd405ad58af8bb8e.js
2 lines (2 loc) · 1.78 KB
/
announcement-bar-announcement-bar-module-es2015.4d0dcd405ad58af8bb8e.js
1
2
(window.webpackJsonp=window.webpackJsonp||[]).push([[2],{"5UAH":function(n,e,t){"use strict";t.r(e),t.d(e,"AnnouncementBarModule",(function(){return p}));var r=t("ofXK"),c=t("tk/3"),o=t("PCNd"),a=t("JIr8"),s=t("lJxs"),i=t("jn67"),u=t("fXoL"),b=t("vHPH");function m(n,e){if(1&n&&(u.Tb(0,"div",1),u.Tb(1,"div",2),u.Pb(2,"img",3),u.Pb(3,"p",4),u.Tb(4,"a",5),u.Bc(5,"Learn More"),u.Sb(),u.Sb(),u.Sb()),2&n){const n=u.fc();u.Ab(2),u.kc("src",n.announcement.imageUrl,u.vc),u.Ab(1),u.kc("innerHTML",n.announcement.message,u.uc),u.Ab(1),u.kc("href",n.announcement.linkUrl,u.vc)}}const l=i.a+"announcements.json";let f=(()=>{class n{constructor(n,e){this.http=n,this.logger=e}ngOnInit(){this.http.get(l).pipe(Object(a.a)(n=>(this.logger.error(new Error(`${l} request failed: ${n.message}`)),[])),Object(s.a)(n=>this.findCurrentAnnouncement(n)),Object(a.a)(n=>(this.logger.error(new Error(`${l} contains invalid data: ${n.message}`)),[]))).subscribe(n=>this.announcement=n)}findCurrentAnnouncement(n){return n.filter(n=>new Date(n.startDate).valueOf()<Date.now()).filter(n=>new Date(n.endDate).valueOf()>Date.now())[0]}}return n.\u0275fac=function(e){return new(e||n)(u.Ob(c.a),u.Ob(b.a))},n.\u0275cmp=u.Ib({type:n,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(n,e){1&n&&u.Ac(0,m,6,3,"div",0),2&n&&u.kc("ngIf",e.announcement)},directives:[r.k],encapsulation:2}),n})(),p=(()=>{class n{constructor(){this.customElementComponent=f}}return n.\u0275mod=u.Mb({type:n}),n.\u0275inj=u.Lb({factory:function(e){return new(e||n)},imports:[[r.c,o.a,c.b]]}),n})()}}]);
//# sourceMappingURL=announcement-bar-announcement-bar-module-es2015.4d0dcd405ad58af8bb8e.js.map