Just to give you some background, I only started my Angular learning journey about a week ago, so feel free to start from the very beginning.
So, how can this be achieved? Inside app.component.ts, there is a standard array that needs to be accessible by multiple child components.
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
masterArray = ['Create', 'Foo', 'Bar'];
}
How can we bring this into child components created by angular cli? For instance, I need to utilize it in the navigation component to form the navigation panel.
<li *ngFor = "let i of masterArray; let ind = index">
<a>{{i}}</a>
</li>