Presently, I am working with two distinct components within my project - a navigation component and a detail component. The navigation component contains several options or items that the user can select. Upon selection by the user, I am attempting to update a masonry grid within the detail component. Although I have successfully updated the masonry grid, I now require calling a method named prepended(). To illustrate:
The code inside the detail component is as follows:
import Masonry from 'masonry-layout';
// during ngOnInit
let grid = document.querySelector('.grid');
let msnry = new Masonry( grid, {
itemSelector: '.grid-item',
});
To execute the following from my navigation component:
msnry.prepended();
I need guidance on how to execute msnry.prepended() from another component. Your help in this matter would be highly appreciated.