+{"ast":null,"code":"import * as i0 from \"@angular/core\";\nimport * as i1 from \"../../services/article.service\";\nimport * as i2 from \"../../services/category.service\";\nimport * as i3 from \"src/app/services/favorites.service\";\nimport * as i4 from \"../../services/login.service\";\nimport * as i5 from \"@angular/router\";\nimport * as i6 from \"@angular/common\";\n\nfunction SoldComponent_div_16_div_1_a_12_Template(rf, ctx) {\n if (rf & 1) {\n const _r5 = i0.ɵɵgetCurrentView();\n\n i0.ɵɵelementStart(0, \"a\", 21);\n i0.ɵɵlistener(\"click\", function SoldComponent_div_16_div_1_a_12_Template_a_click_0_listener() {\n i0.ɵɵrestoreView(_r5);\n const article_r1 = i0.ɵɵnextContext(2).$implicit;\n const ctx_r4 = i0.ɵɵnextContext();\n return ctx_r4.addFavorite(ctx_r4.loginService.currentUser().id_USER, article_r1.id_ARTICLE);\n });\n i0.ɵɵelement(1, \"i\", 22);\n i0.ɵɵelementEnd();\n }\n}\n\nfunction SoldComponent_div_16_div_1_Template(rf, ctx) {\n if (rf & 1) {\n i0.ɵɵelementStart(0, \"div\", 12)(1, \"figure\", 13);\n i0.ɵɵelement(2, \"img\", 14);\n i0.ɵɵelementEnd();\n i0.ɵɵelementStart(3, \"div\", 15)(4, \"a\", 16);\n i0.ɵɵtext(5);\n i0.ɵɵelementEnd();\n i0.ɵɵelementStart(6, \"p\", 17);\n i0.ɵɵtext(7);\n i0.ɵɵelementEnd();\n i0.ɵɵelementStart(8, \"span\", 18);\n i0.ɵɵtext(9);\n i0.ɵɵelementEnd();\n i0.ɵɵelementStart(10, \"span\", 19);\n i0.ɵɵtext(11);\n i0.ɵɵelementEnd();\n i0.ɵɵtemplate(12, SoldComponent_div_16_div_1_a_12_Template, 2, 0, \"a\", 20);\n i0.ɵɵelementEnd()();\n }\n\n if (rf & 2) {\n const article_r1 = i0.ɵɵnextContext().$implicit;\n const ctx_r2 = i0.ɵɵnextContext();\n i0.ɵɵadvance(2);\n i0.ɵɵpropertyInterpolate1(\"src\", \"/api/articles/\", article_r1.id_ARTICLE, \"/image\", i0.ɵɵsanitizeUrl);\n i0.ɵɵadvance(2);\n i0.ɵɵpropertyInterpolate1(\"href\", \"/new/post/\", article_r1.id_ARTICLE, \"\", i0.ɵɵsanitizeUrl);\n i0.ɵɵadvance(1);\n i0.ɵɵtextInterpolate(article_r1.title);\n i0.ɵɵadvance(2);\n i0.ɵɵtextInterpolate1(\"\", article_r1.price, \"\\u20AC\");\n i0.ɵɵadvance(2);\n i0.ɵɵtextInterpolate(article_r1.city);\n i0.ɵɵadvance(2);\n i0.ɵɵtextInterpolate(article_r1.date);\n i0.ɵɵadvance(1);\n i0.ɵɵproperty(\"ngIf\", ctx_r2.loginService.isLogged());\n }\n}\n\nfunction SoldComponent_div_16_Template(rf, ctx) {\n if (rf & 1) {\n i0.ɵɵelementStart(0, \"div\");\n i0.ɵɵtemplate(1, SoldComponent_div_16_div_1_Template, 13, 7, \"div\", 11);\n i0.ɵɵelementEnd();\n }\n\n if (rf & 2) {\n const article_r1 = ctx.$implicit;\n i0.ɵɵadvance(1);\n i0.ɵɵproperty(\"ngIf\", article_r1.sold);\n }\n}\n\nexport let SoldComponent = /*#__PURE__*/(() => {\n class SoldComponent {\n // tslint:disable-next-line:max-line-length\n constructor(articleService, categoryService, favoriteService, loginService, routing, router) {\n this.articleService = articleService;\n this.categoryService = categoryService;\n this.favoriteService = favoriteService;\n this.loginService = loginService;\n this.routing = routing;\n this.router = router;\n this.idCategory = -1;\n this.filtered = false;\n }\n\n ngOnInit() {\n this.getCategories();\n this.getAllArticles();\n }\n\n getCategories() {\n this.categoryService.getCategories().subscribe(category => this.categories = category, error => console.log(error));\n }\n\n getAllArticles() {\n this.articleService.getArticles().subscribe(article => this.articles = article, error => console.log(error));\n }\n\n addFavorite(idUser, idArticle) {\n this.favoriteService.addFavorite(idUser, idArticle);\n }\n\n }\n\n SoldComponent.ɵfac = function SoldComponent_Factory(t) {\n return new (t || SoldComponent)(i0.ɵɵdirectiveInject(i1.ArticleService), i0.ɵɵdirectiveInject(i2.CategoryService), i0.ɵɵdirectiveInject(i3.FavoriteService), i0.ɵɵdirectiveInject(i4.LoginService), i0.ɵɵdirectiveInject(i5.ActivatedRoute), i0.ɵɵdirectiveInject(i5.Router));\n };\n\n SoldComponent.ɵcmp = /*@__PURE__*/i0.ɵɵdefineComponent({\n type: SoldComponent,\n selectors: [[\"sold\"]],\n decls: 17,\n vars: 1,\n consts: [[1, \"section\"], [1, \"container-fluid\"], [1, \"row\"], [1, \"col-xs-12\", \"col-sm-3\", \"col-md-2\"], [1, \"full-width\", 2, \"border\", \"1px solid #E1E1E1\", \"border-radius\", \"4px\", \"padding\", \"5px\"], [\"data-drop-cont\", \".menu-commercial\", 1, \"btn\", \"btn-default\", \"btn-block\", \"hidden-sm\", \"hidden-md\", \"hidden-lg\", \"btn-dropdown-conatiner\"], [\"aria-hidden\", \"true\", 1, \"fa\", \"fa-sort\", \"pull-right\"], [1, \"col-xs-12\", \"col-sm-9\", \"col-md-10\"], [1, \"full-width\", \"bar-info-user\"], [1, \"full-width\", \"container-post\"], [4, \"ngFor\", \"ngForOf\"], [\"class\", \"full-width post\", 4, \"ngIf\"], [1, \"full-width\", \"post\"], [1, \"full-width\", \"post-img\"], [\"alt\", \"\", 1, \"img-responsive\", 3, \"src\"], [1, \"full-width\", \"post-info\"], [1, \"full-width\", \"post-info-title\", 3, \"href\"], [1, \"full-width\", \"post-info-price\"], [1, \"post-info-zone\"], [1, \"post-info-date\"], [3, \"click\", 4, \"ngIf\"], [3, \"click\"], [1, \"fa\", \"fa-heart-o\", \"post-info-like\"]],\n template: function SoldComponent_Template(rf, ctx) {\n if (rf & 1) {\n i0.ɵɵelementStart(0, \"section\", 0)(1, \"div\", 1)(2, \"div\", 2)(3, \"div\", 3)(4, \"div\", 4)(5, \"button\", 5);\n i0.ɵɵtext(6, \" FILTROS \");\n i0.ɵɵelement(7, \"i\", 6);\n i0.ɵɵelementEnd();\n i0.ɵɵelementStart(8, \"p\")(9, \"small\");\n i0.ɵɵtext(10, \"Anuncios segunda mano. Las mejores ofertas en de segunda mano y de ocasi\\u00F3n solo en Wallypop\");\n i0.ɵɵelementEnd()()()();\n i0.ɵɵelementStart(11, \"div\", 7)(12, \"div\", 8)(13, \"div\");\n i0.ɵɵtext(14, \"ANUNCIOS VENDIDOS\");\n i0.ɵɵelementEnd()();\n i0.ɵɵelementStart(15, \"div\", 9);\n i0.ɵɵtemplate(16, SoldComponent_div_16_Template, 2, 1, \"div\", 10);\n i0.ɵɵelementEnd()()()()();\n }\n\n if (rf & 2) {\n i0.ɵɵadvance(16);\n i0.ɵɵproperty(\"ngForOf\", ctx.articles);\n }\n },\n directives: [i6.NgForOf, i6.NgIf],\n encapsulation: 2\n });\n return SoldComponent;\n})();","map":null,"metadata":{},"sourceType":"module"}
0 commit comments