I am learning Angular 11. I am following this code. My code is like below.
carousel.interface.ts
export interface Slide {
headline?: string;
src: string;
}
carousel.component.ts
import { Component, Input } from '@angular/core';
import { Slide } from './carousel.interface';
@Component({
selector : 'carousel',
templateUrl : './carousel.component.html',
styleUrls : ['./carousel.component.scss'],
})
export class CarouselComponent {
@Input() slides: Slide[];
currentSlide = 0;
constructor() { }
}
Are { Slide }
and Slide[]
same ? If same then why slides
is not populating ?
I read this SO post. But I think issue of that post is different.