description not found for using
Shentia opened this issue ยท comments
Ahmadreza Shamimi commented
๐ Bug report
Description
I am using the Scully and I can show the title in the blog but when I am using description I got an error when running ng build.
Also I tried
ngOnInit(): void {
this.routeSub = this.scullyService.available$.subscribe((posts) => {
this.posts = posts.filter((post) => post.title);
**this.posts = posts.filter((post) => post.description);**
});
}
but it doesnt work but when I change to publish I can see on blog (true or false)
๐ฌ Minimal Reproduction
https://ibb.co/PQscy1D
https://ibb.co/6yKdC9p
๐ปYour Environment
.ts file
import { Component, OnInit, OnDestroy } from '@angular/core';
import { ScullyRoute, ScullyRoutesService } from '@scullyio/ng-lib';
import { Subscription } from 'rxjs';
@Component({
selector: 'app-articles',
templateUrl: './articles.component.html',
styleUrls: ['./articles.component.scss'],
})
export class ArticlesComponent implements OnInit, OnDestroy {
posts: ScullyRoute[] = [];
private routeSub: Subscription | undefined;
constructor(private scullyService: ScullyRoutesService) {}
ngOnInit(): void {
this.routeSub = this.scullyService.available$.subscribe((posts) => {
this.posts = posts.filter((post) => post.title);
});
}
ngOnDestroy(): void {
this.routeSub?.unsubscribe();
}
}
.html file
<div class="list-group mt-3">
<a *ngFor="let post of posts" [routerLink]="post.route" class="list-group-item list-group-item-action">
<div class="d-flex w-100 justify-content-between">
<h5 class="mb-1">{{post.title}}</h5>
</div>
<p class="mb-1">{{post.description}}</p>
</a>
</div>
Angular Version:
Angular CLI: 15.0.4
Node: 18.12.1
Package Manager: npm 8.19.2
OS: darwin arm64
Angular: 15.0.4
... animations, cli, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router
Package Version
---------------------------------------------------------
@angular-devkit/architect 0.1500.4
@angular-devkit/build-angular 15.0.4
@angular-devkit/core 15.0.4
@angular-devkit/schematics 15.0.4
@schematics/angular 15.0.4
rxjs 7.5.7
typescript 4.8.4
```
Angular CLI: 15.0.4
Node: 18.12.1
Package Manager: npm 8.19.2
OS: darwin arm64
Angular: 15.0.4
... animations, cli, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router
Package Version
---------------------------------------------------------
@angular-devkit/architect 0.1500.4
@angular-devkit/build-angular 15.0.4
@angular-devkit/core 15.0.4
@angular-devkit/schematics 15.0.4
@schematics/angular 15.0.4
rxjs 7.5.7
typescript 4.8.4
```
Scully Version:
```
{
"name": "my-blog",
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"watch": "ng build --watch --configuration development",
"test": "ng test",
"scully": "npx scully --",
"scully:serve": "npx scully serve --"
},
"private": true,
"dependencies": {
"@angular/animations": "^15.0.0",
"@angular/common": "^15.0.0",
"@angular/compiler": "^15.0.0",
"@angular/core": "^15.0.0",
"@angular/forms": "^15.0.0",
"@angular/platform-browser": "^15.0.0",
"@angular/platform-browser-dynamic": "^15.0.0",
"@angular/router": "^15.0.0",
"@scullyio/init": "^2.1.41",
"@scullyio/scully-plugin-puppeteer": "^2.1.41",
"bootstrap": "^5.2.3",
"rxjs": "~7.5.0",
"tslib": "^2.3.0",
"zone.js": "~0.12.0"
},
"devDependencies": {
"@angular-devkit/build-angular": "^15.0.2",
"@angular/cli": "~15.0.2",
"@angular/compiler-cli": "^15.0.0",
"@types/jasmine": "~4.3.0",
"jasmine-core": "~4.5.0",
"karma": "~6.4.0",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage": "~2.2.0",
"karma-jasmine": "~5.1.0",
"karma-jasmine-html-reporter": "~2.0.0",
"prettier": "2.8.1",
"typescript": "~4.8.2"
}
}
```
๐ฅ Exception or Error
```
Error: src/app/articles/articles.component.html:6:28 - error TS4111: Property 'description' comes from an index signature, so it must be accessed with ['description'].
6 {{post.description}}
~~~~~~~~~~~
src/app/articles/articles.component.ts:7:16
7 templateUrl: './articles.component.html',
~~~~~~~~~~~~~~~~~~~~~~~~~~~
Error occurs in the template of component ArticlesComponent.
```
Nelson Gutierrez commented
Can you share your .md files on your blog folder?